Skip to content

Commit 1c6029a

Browse files
Fixed test due to change in exception type raised in Py 3.11
1 parent 173488f commit 1c6029a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dpctl/tests/test_sycl_queue_manager.py

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

2020
import contextlib
21+
import sys
2122

2223
import pytest
2324
from helper import has_cpu, has_gpu, has_sycl_platforms
@@ -216,7 +217,13 @@ def factory(_):
216217
"factory, exception, match",
217218
[
218219
(True, TypeError, "object is not callable"),
219-
(lambda x: None, AttributeError, "no attribute '__exit__'"),
220+
(lambda x: None, AttributeError, "no attribute '__exit__'")
221+
if sys.version_info < (3, 11)
222+
else (
223+
lambda x: None,
224+
TypeError,
225+
r".* object does not support the context manager protocol",
226+
),
220227
],
221228
)
222229
def test_nested_context_factory_exception_if_wrong_factory(

0 commit comments

Comments
 (0)