Skip to content

Commit 5544129

Browse files
Wrap produce_event call in try/except SyclQueueCreationError
This is to skip the test on platforms where OpenCL backend for CPU devices is not present
1 parent e4064fa commit 5544129

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dpctl/tests/test_sycl_event.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ def test_execution_status():
112112

113113

114114
def test_execution_status_nondefault_event():
115-
event = produce_event()
115+
try:
116+
event = produce_event()
117+
except dpctl.SyclQueueCreationError:
118+
pytest.skip("OpenCL CPU queue could not be created")
116119
try:
117120
event_status = event.execution_status
118121
except ValueError:
@@ -127,7 +130,10 @@ def test_backend():
127130
dpctl.SyclEvent().backend
128131
except ValueError:
129132
pytest.fail("Failed to get backend from event")
130-
event = produce_event()
133+
try:
134+
event = produce_event()
135+
except dpctl.SyclQueueCreationError:
136+
pytest.skip("OpenCL CPU queue could not be created")
131137
try:
132138
event.backend
133139
except ValueError:

0 commit comments

Comments
 (0)