Skip to content

Commit 43f32df

Browse files
Improved coverage of _types.pxi
1 parent a6498a9 commit 43f32df

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def test_allocate_usm_ndarray(shape, usm_type):
7474
"f8",
7575
"c8",
7676
"c16",
77+
b"float32",
7778
np.dtype("d"),
7879
np.half,
7980
],
@@ -83,6 +84,12 @@ def test_dtypes(dtype):
8384
assert Xusm.itemsize == np.dtype(dtype).itemsize
8485

8586

87+
@pytest.mark.parametrize("dtype", ["", ">f4", "invalid", 123])
88+
def test_dtypes_invalid(dtype):
89+
with pytest.raises((TypeError, ValueError)):
90+
dpt.usm_ndarray((1,), dtype=dtype)
91+
92+
8693
def test_properties():
8794
"""
8895
Test that properties execute

0 commit comments

Comments
 (0)