diff --git a/tests/test_arraycreation.py b/tests/test_arraycreation.py index 3ea5d230817..c64f3646690 100644 --- a/tests/test_arraycreation.py +++ b/tests/test_arraycreation.py @@ -129,6 +129,15 @@ def test_diag_diagflat(v, k): assert_array_equal(expected, result) +def test_diag_diagflat_raise_error(): + ia = dpnp.array([0, 1, 2, 3, 4]) + with pytest.raises(TypeError): + dpnp.diag(ia, k=2.0) + + with pytest.raises(TypeError): + dpnp.diagflat(ia, k=2.0) + + @pytest.mark.parametrize( "seq", [ @@ -488,6 +497,16 @@ def test_vander(array, dtype, n, increase): assert_allclose(vander_func(numpy, a_np), vander_func(dpnp, a_dpnp)) +def test_vander_raise_error(): + a = dpnp.array([1, 2, 3, 4]) + with pytest.raises(TypeError): + dpnp.vander(a, N=1.0) + + a = dpnp.array([[1, 2], [3, 4]]) + with pytest.raises(ValueError): + dpnp.vander(a) + + @pytest.mark.parametrize( "sequence", [[1, 2, 3, 4], (1, 2, 3, 4)],