Skip to content

Commit c963864

Browse files
Strengthened test for select_device_with_aspects
1 parent 295982c commit c963864

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dpctl/tests/test_sycl_device.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,17 @@ def unsupported_aspect(request):
176176

177177
def test_supported_aspect(supported_aspect):
178178
try:
179-
dpctl.select_device_with_aspects(supported_aspect)
179+
d = dpctl.SyclDevice()
180+
has_it = getattr(d, "has_aspect_" + supported_aspect)
181+
except dpctl.SyclDevieCreationError:
182+
has_it = False
183+
try:
184+
d_wa = dpctl.select_device_with_aspects(supported_aspect)
185+
assert getattr(d_wa, "has_aspect_" + supported_aspect)
180186
except dpctl.SyclDeviceCreationError:
181187
# ValueError may be raised if no device with
182188
# requested aspect charateristics is available
183-
pass
189+
assert not has_it
184190

185191

186192
def test_unsupported_aspect(unsupported_aspect):

0 commit comments

Comments
 (0)