Skip to content

Commit 62cb7e3

Browse files
Add tests to dpctl._dev.verbose
1 parent 771041b commit 62cb7e3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

dpctl/tests/test_service.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import os.path
2525
import re
2626

27+
import pytest
28+
2729
import dpctl
2830

2931

@@ -95,3 +97,20 @@ def test___version__():
9597
r"0|[1-9][0-9]*))?(\+.*)?$"
9698
)
9799
assert re.match(reg_expr, dpctl_ver) is not None
100+
101+
102+
def test_dev_utils():
103+
import dpctl._dev as dd
104+
105+
with dd.verbose():
106+
dpctl.SyclDevice().parent_device
107+
with dd.verbose(verbosity="error"):
108+
dpctl.SyclDevice().parent_device
109+
with pytest.raises(ValueError):
110+
with dd.verbose(verbosity="blah"):
111+
dpctl.SyclDevice().parent_device
112+
with dd.verbose(log_dir="/tmp"):
113+
dpctl.SyclDevice().parent_device
114+
with pytest.raises(ValueError):
115+
with dd.verbose(log_dir="/not_a_dir"):
116+
dpctl.SyclDevice().parent_device

0 commit comments

Comments
 (0)