Skip to content

Commit 83e72a1

Browse files
committed
use ValueError for shape inconsistency, to be aligned with dpctl
1 parent 653ce2e commit 83e72a1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

tests/test_mathematical.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def test_invalid_shape(self, shape, dtype):
633633
dp_array = dpnp.arange(10, dtype=dtype)
634634
dp_out = dpnp.empty(shape, dtype=dtype)
635635

636-
with pytest.raises(TypeError):
636+
with pytest.raises(ValueError):
637637
dpnp.ceil(dp_array, out=dp_out)
638638

639639

@@ -673,7 +673,7 @@ def test_invalid_shape(self, shape, dtype):
673673
dp_array = dpnp.arange(10, dtype=dtype)
674674
dp_out = dpnp.empty(shape, dtype=dtype)
675675

676-
with pytest.raises(TypeError):
676+
with pytest.raises(ValueError):
677677
dpnp.floor(dp_array, out=dp_out)
678678

679679

@@ -713,7 +713,7 @@ def test_invalid_shape(self, shape, dtype):
713713
dp_array = dpnp.arange(10, dtype=dtype)
714714
dp_out = dpnp.empty(shape, dtype=dtype)
715715

716-
with pytest.raises(TypeError):
716+
with pytest.raises(ValueError):
717717
dpnp.trunc(dp_array, out=dp_out)
718718

719719

@@ -791,7 +791,7 @@ def test_invalid_shape(self, shape):
791791
dp_array2 = dpnp.arange(5, 15)
792792
dp_out = dpnp.empty(shape)
793793

794-
with pytest.raises(TypeError):
794+
with pytest.raises(ValueError):
795795
dpnp.add(dp_array1, dp_array2, out=dp_out)
796796

797797
@pytest.mark.parametrize(
@@ -880,7 +880,7 @@ def test_invalid_shape(self, shape):
880880
dp_array2 = dpnp.arange(5, 15)
881881
dp_out = dpnp.empty(shape)
882882

883-
with pytest.raises(TypeError):
883+
with pytest.raises(ValueError):
884884
dpnp.multiply(dp_array1, dp_array2, out=dp_out)
885885

886886
@pytest.mark.parametrize(

tests/test_umath.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def test_invalid_shape(self, shape):
171171
dp_array = dpnp.arange(10)
172172
dp_out = dpnp.empty(shape, dtype=dp_array.dtype)
173173

174-
with pytest.raises(TypeError):
174+
with pytest.raises(ValueError):
175175
dpnp.sin(dp_array, out=dp_out)
176176

177177

@@ -254,7 +254,7 @@ def test_invalid_shape(self, shape):
254254
dp_array = dpnp.arange(10)
255255
dp_out = dpnp.empty(shape, dtype=dp_array.dtype)
256256

257-
with pytest.raises(TypeError):
257+
with pytest.raises(ValueError):
258258
dpnp.cos(dp_array, out=dp_out)
259259

260260

@@ -337,7 +337,7 @@ def test_invalid_shape(self, shape):
337337
dp_array = dpnp.arange(10)
338338
dp_out = dpnp.empty(shape, dtype=dp_array.dtype)
339339

340-
with pytest.raises(TypeError):
340+
with pytest.raises(ValueError):
341341
dpnp.log(dp_array, out=dp_out)
342342

343343

@@ -613,7 +613,7 @@ def test_invalid_shape(self, shape):
613613
dp_array = dpnp.arange(10, dtype=dpnp.float32)
614614
dp_out = dpnp.empty(shape, dtype=dpnp.float32)
615615

616-
with pytest.raises(TypeError):
616+
with pytest.raises(ValueError):
617617
dpnp.sqrt(dp_array, out=dp_out)
618618

619619
@pytest.mark.parametrize(
@@ -675,7 +675,7 @@ def test_invalid_shape(self, shape):
675675
dp_array = dpnp.arange(10, dtype=dpnp.float32)
676676
dp_out = dpnp.empty(shape, dtype=dpnp.float32)
677677

678-
with pytest.raises(TypeError):
678+
with pytest.raises(ValueError):
679679
dpnp.square(dp_array, out=dp_out)
680680

681681
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)