Skip to content

Commit 8725e96

Browse files
authored
Skip test where unsupported field values are used. (#1498)
1 parent 9711fe3 commit 8725e96

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

cuda_core/tests/system/test_system_device.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ def test_persistence_mode_enabled():
262262

263263

264264
def test_field_values():
265+
skip_reasons = set()
266+
265267
for device in system.Device.get_all_devices():
266268
# TODO: Are there any fields that return double's? It would be good to
267269
# test those.
@@ -271,7 +273,12 @@ def test_field_values():
271273
system.FieldId.DEV_PCIE_COUNT_TX_BYTES,
272274
]
273275
field_values = device.get_field_values(field_ids)
274-
field_values.validate()
276+
277+
try:
278+
field_values.validate()
279+
except system.NotSupportedError:
280+
skip_reasons.add(f"Field values {field_ids} not supported on '{device.name}'")
281+
continue
275282

276283
with pytest.raises(TypeError):
277284
field_values["invalid_index"]
@@ -307,3 +314,6 @@ def test_field_values():
307314
field_values.validate()
308315
assert len(field_values) == 1
309316
assert field_values[0].value <= old_value
317+
318+
if skip_reasons:
319+
pytest.skip(" ; ".join(skip_reasons))

0 commit comments

Comments
 (0)