diff --git a/tests/test_arraycreation.py b/tests/test_arraycreation.py index d84f6db1a8b..6f9e7ee5d25 100644 --- a/tests/test_arraycreation.py +++ b/tests/test_arraycreation.py @@ -269,14 +269,25 @@ def test_tri_default_dtype(): @pytest.mark.parametrize( "k", - [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6], - ids=["-6", "-5", "-4", "-3", "-2", "-1", "0", "1", "2", "3", "4", "5", "6"], + [-3, -2, -1, 0, 1, 2, 3, 4, 5, numpy.array(1), dpnp.array(2), dpt.asarray(3)], + ids=[ + "-3", + "-2", + "-1", + "0", + "1", + "2", + "3", + "4", + "5", + "np.array(1)", + "dpnp.array(2)", + "dpt.asarray(3)", + ], ) @pytest.mark.parametrize( "m", [ - [0, 1, 2, 3, 4], - [1, 1, 1, 1, 1], [[0, 0], [0, 0]], [[1, 2], [1, 2]], [[1, 2], [3, 4]], @@ -284,8 +295,6 @@ def test_tri_default_dtype(): [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]], ], ids=[ - "[0, 1, 2, 3, 4]", - "[1, 1, 1, 1, 1]", "[[0, 0], [0, 0]]", "[[1, 2], [1, 2]]", "[[1, 2], [3, 4]]", @@ -293,8 +302,10 @@ def test_tri_default_dtype(): "[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]", ], ) -def test_tril(m, k): - a = numpy.array(m) +@pytest.mark.usefixtures("allow_fall_back_on_numpy") +@pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False)) +def test_tril(m, k, dtype): + a = numpy.array(m, dtype=dtype) ia = dpnp.array(a) expected = numpy.tril(a, k=k) result = dpnp.tril(ia, k=k) @@ -303,26 +314,39 @@ def test_tril(m, k): @pytest.mark.parametrize( "k", - [-4, -3, -2, -1, 0, 1, 2, 3, 4], - ids=["-4", "-3", "-2", "-1", "0", "1", "2", "3", "4"], + [-3, -2, -1, 0, 1, 2, 3, 4, 5, numpy.array(1), dpnp.array(2), dpt.asarray(3)], + ids=[ + "-3", + "-2", + "-1", + "0", + "1", + "2", + "3", + "4", + "5", + "np.array(1)", + "dpnp.array(2)", + "dpt.asarray(3)", + ], ) @pytest.mark.parametrize( "m", [ - [0, 1, 2, 3, 4], [[1, 2], [3, 4]], [[0, 1, 2], [3, 4, 5], [6, 7, 8]], [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]], ], ids=[ - "[0, 1, 2, 3, 4]", "[[1, 2], [3, 4]]", "[[0, 1, 2], [3, 4, 5], [6, 7, 8]]", "[[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]", ], ) -def test_triu(m, k): - a = numpy.array(m) +@pytest.mark.usefixtures("allow_fall_back_on_numpy") +@pytest.mark.parametrize("dtype", get_all_dtypes(no_float16=False)) +def test_triu(m, k, dtype): + a = numpy.array(m, dtype=dtype) ia = dpnp.array(a) expected = numpy.triu(a, k=k) result = dpnp.triu(ia, k=k)