Skip to content

Commit 1788952

Browse files
Handle SyclQueueCreationError
1 parent 08c4c04 commit 1788952

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

dpctl/tests/test_sycl_queue_memcpy.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"""
1919

2020
import pytest
21-
from helper import has_sycl_platforms
2221

2322
import dpctl
2423
import dpctl.memory
@@ -30,12 +29,11 @@ def _create_memory(q):
3029
return mobj
3130

3231

33-
@pytest.mark.skipif(
34-
not has_sycl_platforms(),
35-
reason="No SYCL devices except the default host device.",
36-
)
3732
def test_memcpy_copy_usm_to_usm():
38-
q = dpctl.SyclQueue()
33+
try:
34+
q = dpctl.SyclQueue()
35+
except dpctl.SyclQueueCreationError:
36+
pytest.skip("Default constructor for SyclQueue failed")
3937
mobj1 = _create_memory(q)
4038
mobj2 = _create_memory(q)
4139

@@ -49,12 +47,11 @@ def test_memcpy_copy_usm_to_usm():
4947
assert mv2[:3], b"123"
5048

5149

52-
# @pytest.mark.skipif(
53-
# not has_sycl_platforms(),
54-
# reason="No SYCL devices except the default host device."
55-
# )
5650
def test_memcpy_type_error():
57-
q = dpctl.SyclQueue()
51+
try:
52+
q = dpctl.SyclQueue()
53+
except dpctl.SyclQueueCreationError:
54+
pytest.skip("Default constructor for SyclQueue failed")
5855
mobj = _create_memory(q)
5956

6057
with pytest.raises(TypeError) as cm:

0 commit comments

Comments
 (0)