Skip to content

Commit 20cedd6

Browse files
Added a test to check validation for supported dtype
1 parent 2693972 commit 20cedd6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dpctl/tests/test_tensor_asarray.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,13 @@ def test_asarray_copy_false():
220220
assert Y6 is Xf
221221
with pytest.raises(ValueError):
222222
dpt.asarray(Xf, copy=False, order="C")
223+
224+
225+
def test_asarray_invalid_dtype():
226+
try:
227+
q = dpctl.SyclQueue()
228+
except dpctl.SyclQueueCreationError:
229+
pytest.skip("Could not create a queue")
230+
Xnp = np.array([1, 2, 3], dtype=object)
231+
with pytest.raises(TypeError):
232+
dpt.asarray(Xnp, sycl_queue=q)

0 commit comments

Comments
 (0)