Skip to content

Commit 7106845

Browse files
committed
parametrize test_peer_device_arg_validation
1 parent bb1f1d9 commit 7106845

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

dpctl/tests/test_sycl_device.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,16 @@ def test_enable_disable_peer(platform_name):
390390
)
391391

392392

393-
def test_peer_device_arg_validation():
393+
@pytest.mark.parametrize(
394+
"method",
395+
[
396+
"can_access_peer_access_supported",
397+
"can_access_peer_atomics_supported",
398+
"enable_peer_access",
399+
"disable_peer_access",
400+
],
401+
)
402+
def test_peer_device_arg_validation(method):
394403
"""
395404
Test for validation of arguments to peer access related methods.
396405
"""
@@ -399,11 +408,6 @@ def test_peer_device_arg_validation():
399408
except dpctl.SyclDeviceCreationError:
400409
pytest.skip("No default device available")
401410
bad_dev = dict()
411+
callable = getattr(dev, method)
402412
with pytest.raises(TypeError):
403-
dev.can_access_peer_access_supported(bad_dev)
404-
with pytest.raises(TypeError):
405-
dev.can_access_peer_atomics_supported(bad_dev)
406-
with pytest.raises(TypeError):
407-
dev.enable_peer_access(bad_dev)
408-
with pytest.raises(TypeError):
409-
dev.disable_peer_access(bad_dev)
413+
callable(bad_dev)

0 commit comments

Comments
 (0)