diff --git a/dpnp/tests/helper.py b/dpnp/tests/helper.py index da07e37949c9..56d8dd5ac2d2 100644 --- a/dpnp/tests/helper.py +++ b/dpnp/tests/helper.py @@ -325,6 +325,36 @@ def get_integer_dtypes(all_int_types=False, no_unsigned=False): return dtypes +def get_integer_float_dtypes( + all_int_types=False, + no_unsigned=False, + no_float16=True, + device=None, + xfail_dtypes=None, + exclude=None, +): + """ + Build a list of integer and float types supported by DPNP. + """ + dtypes = get_integer_dtypes( + all_int_types=all_int_types, no_unsigned=no_unsigned + ) + dtypes += get_float_dtypes(no_float16=no_float16, device=device) + + def mark_xfail(dtype): + if xfail_dtypes is not None and dtype in xfail_dtypes: + return pytest.param(dtype, marks=pytest.mark.xfail) + return dtype + + def not_excluded(dtype): + if exclude is None: + return True + return dtype not in exclude + + dtypes = [mark_xfail(dtype) for dtype in dtypes if not_excluded(dtype)] + return dtypes + + def has_support_aspect16(device=None): """ Return True if the device supports 16-bit precision floating point operations, diff --git a/dpnp/tests/test_binary_ufuncs.py b/dpnp/tests/test_binary_ufuncs.py index 41e72b6b957d..362aae3a047b 100644 --- a/dpnp/tests/test_binary_ufuncs.py +++ b/dpnp/tests/test_binary_ufuncs.py @@ -20,6 +20,7 @@ get_float_complex_dtypes, get_float_dtypes, get_integer_dtypes, + get_integer_float_dtypes, has_support_aspect16, numpy_version, ) @@ -141,7 +142,7 @@ def test_invalid_out(self, xp, out): @pytest.mark.parametrize("func", ["fmax", "fmin", "maximum", "minimum"]) class TestBoundFuncs: @pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True)) - def test_out(self, func, dtype): + def test_basic(self, func, dtype): a = generate_random_numpy_array(10, dtype) b = generate_random_numpy_array(10, dtype) expected = getattr(numpy, func)(a, b) @@ -278,7 +279,7 @@ def test_invalid_out(self, xp, out): @pytest.mark.parametrize("func", ["floor_divide", "remainder"]) class TestFloorDivideRemainder: - ALL_DTYPES = get_all_dtypes(no_none=True, no_bool=True, no_complex=True) + ALL_DTYPES = get_integer_float_dtypes() def do_inplace_op(self, base, other, func): if func == "floor_divide": diff --git a/dpnp/tests/test_histogram.py b/dpnp/tests/test_histogram.py index cca696bde25f..06ec6f3fde67 100644 --- a/dpnp/tests/test_histogram.py +++ b/dpnp/tests/test_histogram.py @@ -19,15 +19,14 @@ get_float_complex_dtypes, get_float_dtypes, get_integer_dtypes, + get_integer_float_dtypes, has_support_aspect64, numpy_version, ) class TestDigitize: - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("right", [True, False]) @pytest.mark.parametrize( "x, bins", @@ -73,12 +72,8 @@ def test_digitize_inf(self, dtype, right): expected = numpy.digitize(x, bins, right=right) assert_dtype_allclose(result, expected) - @pytest.mark.parametrize( - "dtype_x", get_all_dtypes(no_bool=True, no_complex=True) - ) - @pytest.mark.parametrize( - "dtype_bins", get_all_dtypes(no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype_x", get_integer_float_dtypes()) + @pytest.mark.parametrize("dtype_bins", get_integer_float_dtypes()) @pytest.mark.parametrize("right", [True, False]) def test_digitize_diff_types(self, dtype_x, dtype_bins, right): x = numpy.array([1, 2, 3, 4, 5], dtype=dtype_x) @@ -90,9 +85,7 @@ def test_digitize_diff_types(self, dtype_x, dtype_bins, right): expected = numpy.digitize(x, bins, right=right) assert_dtype_allclose(result, expected) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize( "x, bins", [ diff --git a/dpnp/tests/test_linalg.py b/dpnp/tests/test_linalg.py index 3e02985a82eb..192ac552ebd1 100644 --- a/dpnp/tests/test_linalg.py +++ b/dpnp/tests/test_linalg.py @@ -22,6 +22,7 @@ get_all_dtypes, get_complex_dtypes, get_float_complex_dtypes, + get_integer_float_dtypes, has_support_aspect64, is_cpu_device, is_cuda_device, @@ -1409,9 +1410,7 @@ def test_einsum_tensor(self): result = dpnp.einsum("ijij->", tensor_dp) assert_dtype_allclose(result, expected) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_complex=True, no_none=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_different_paths(self, dtype): # Simple test, designed to exercise most specialized code paths, # note the +0.5 for floats. This makes sure we use a float value diff --git a/dpnp/tests/test_logic.py b/dpnp/tests/test_logic.py index b820528f9470..3e6f88ee4442 100644 --- a/dpnp/tests/test_logic.py +++ b/dpnp/tests/test_logic.py @@ -8,6 +8,7 @@ get_all_dtypes, get_float_complex_dtypes, get_float_dtypes, + get_integer_float_dtypes, ) @@ -83,7 +84,7 @@ def check_raises(func_name, exception, *args, **kwargs): check_raises(func, TypeError, [0, 1, 2, 3]) -@pytest.mark.parametrize("dtype", get_all_dtypes(no_bool=True, no_complex=True)) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_allclose(dtype): a = numpy.random.rand(10) b = a + numpy.random.rand(10) * 1e-8 @@ -508,7 +509,7 @@ def test_infinity_sign_errors(func): getattr(dpnp, func)(x, out=out) -@pytest.mark.parametrize("dtype", get_all_dtypes(no_bool=True, no_complex=True)) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize( "rtol", [1e-05, dpnp.array(1e-05), dpnp.full(10, 1e-05)] ) @@ -549,7 +550,7 @@ def test_array_equiv(a, b): assert_equal(result, expected) -@pytest.mark.parametrize("dtype", get_all_dtypes(no_bool=True, no_complex=True)) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_array_equiv_dtype(dtype): a = numpy.array([1, 2], dtype=dtype) b = numpy.array([1, 2], dtype=dtype) @@ -575,7 +576,7 @@ def test_array_equiv_scalar(a): assert_equal(result, expected) -@pytest.mark.parametrize("dtype", get_all_dtypes(no_bool=True, no_complex=True)) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("equal_nan", [True, False]) def test_array_equal_dtype(dtype, equal_nan): a = numpy.array([1, 2], dtype=dtype) diff --git a/dpnp/tests/test_manipulation.py b/dpnp/tests/test_manipulation.py index c1e2562cccf7..caa9401487b3 100644 --- a/dpnp/tests/test_manipulation.py +++ b/dpnp/tests/test_manipulation.py @@ -20,6 +20,7 @@ get_float_complex_dtypes, get_float_dtypes, get_integer_dtypes, + get_integer_float_dtypes, has_support_aspect64, numpy_version, ) @@ -325,9 +326,7 @@ class TestCopyTo: ] testdata += [ ([1, -1, 0], dtype) - for dtype in get_all_dtypes( - no_none=True, no_bool=True, no_complex=True, no_unsigned=True - ) + for dtype in get_integer_float_dtypes(no_unsigned=True) ] testdata += [([0.1, 0.0, -0.1], dtype) for dtype in get_float_dtypes()] testdata += [([1j, -1j, 1 - 2j], dtype) for dtype in get_complex_dtypes()] diff --git a/dpnp/tests/test_mathematical.py b/dpnp/tests/test_mathematical.py index 9d745ac55952..c416a55e5796 100644 --- a/dpnp/tests/test_mathematical.py +++ b/dpnp/tests/test_mathematical.py @@ -29,6 +29,7 @@ get_float_complex_dtypes, get_float_dtypes, get_integer_dtypes, + get_integer_float_dtypes, has_support_aspect16, has_support_aspect64, numpy_version, @@ -50,9 +51,7 @@ def test_angle_bool(self, deg): # determined by Type Promotion Rules. assert_dtype_allclose(result, expected, check_only_type_kind=True) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_angle(self, dtype, deg): ia = dpnp.arange(10, dtype=dtype) a = ia.asnumpy() @@ -105,9 +104,7 @@ def test_conj_out(self, dtype): class TestClip: - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_none=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("order", ["C", "F", "A", "K", None]) def test_clip(self, dtype, order): ia = dpnp.asarray([[1, 2, 8], [1, 6, 4], [9, 5, 1]], dtype=dtype) @@ -119,9 +116,7 @@ def test_clip(self, dtype, order): assert expected.flags.c_contiguous == result.flags.c_contiguous assert expected.flags.f_contiguous == result.flags.f_contiguous - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_none=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_clip_arrays(self, dtype): ia = dpnp.asarray([1, 2, 8, 1, 6, 4, 1], dtype=dtype) a = dpnp.asnumpy(ia) @@ -133,9 +128,7 @@ def test_clip_arrays(self, dtype): expected = numpy.clip(a, min_v.asnumpy(), max_v.asnumpy()) assert_allclose(result, expected) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_none=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("in_dp", [dpnp, dpt]) @pytest.mark.parametrize("out_dp", [dpnp, dpt]) def test_clip_out(self, dtype, in_dp, out_dp): @@ -273,9 +266,7 @@ def test_axis_tuple(self): a = dpnp.ones((3, 4)) assert_raises(TypeError, dpnp.cumlogsumexp, a, axis=(0, 1)) - @pytest.mark.parametrize( - "in_dt", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("in_dt", get_integer_float_dtypes()) @pytest.mark.parametrize("dt", get_all_dtypes(no_bool=True)) def test_dtype(self, in_dt, dt): a = dpnp.ones(100, dtype=in_dt) @@ -1090,9 +1081,7 @@ def test_0d(self): na = a.asnumpy() assert_dtype_allclose(dpnp.i0(a), numpy.i0(na)) - @pytest.mark.parametrize( - "dt", get_all_dtypes(no_bool=True, no_none=True, no_complex=True) - ) + @pytest.mark.parametrize("dt", get_integer_float_dtypes()) def test_1d(self, dt): a = numpy.array( [0.49842636, 0.6969809, 0.22011976, 0.0155549, 10.0], dtype=dt @@ -1196,9 +1185,7 @@ def test_add(self, dtype, lhs, rhs): def test_arctan2(self, dtype, lhs, rhs): self._test_mathematical("arctan2", dtype, lhs, rhs) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_copysign(self, dtype, lhs, rhs): self._test_mathematical("copysign", dtype, lhs, rhs) @@ -1206,20 +1193,16 @@ def test_copysign(self, dtype, lhs, rhs): def test_divide(self, dtype, lhs, rhs): self._test_mathematical("divide", dtype, lhs, rhs) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True)) def test_fmax(self, dtype, lhs, rhs): self._test_mathematical("fmax", dtype, lhs, rhs, check_type=False) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True)) def test_fmin(self, dtype, lhs, rhs): self._test_mathematical("fmin", dtype, lhs, rhs, check_type=False) @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) + "dtype", get_all_dtypes(no_none=True, no_complex=True) ) def test_fmod(self, dtype, lhs, rhs): if rhs == 0.3 and not has_support_aspect64(): @@ -1247,9 +1230,7 @@ def test_floor_divide(self, dtype, lhs, rhs): "floor_divide", dtype, lhs, rhs, check_type=False ) - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_hypot(self, dtype, lhs, rhs): self._test_mathematical("hypot", dtype, lhs, rhs) @@ -1809,12 +1790,7 @@ def test_rand(self, dt): expected = numpy.unwrap(a) assert_dtype_allclose(result, expected) - @pytest.mark.parametrize( - "dt", - get_all_dtypes( - no_none=True, no_bool=True, no_complex=True, no_unsigned=True - ), - ) + @pytest.mark.parametrize("dt", get_integer_float_dtypes(no_unsigned=True)) def test_period(self, dt): a = numpy.array([1, 1 + 108], dtype=dt) ia = dpnp.array(a) @@ -1824,12 +1800,7 @@ def test_period(self, dt): expected = numpy.unwrap(a, period=107) assert_array_equal(result, expected) - @pytest.mark.parametrize( - "dt", - get_all_dtypes( - no_none=True, no_bool=True, no_complex=True, no_unsigned=True - ), - ) + @pytest.mark.parametrize("dt", get_integer_float_dtypes(no_unsigned=True)) def test_rand_period(self, dt): a = generate_random_numpy_array(10, dt, low=-100, high=100) ia = dpnp.array(a) @@ -1848,12 +1819,7 @@ def test_simple_seq(self): assert_array_equal(result, expected) assert_array_equal(result, isimple_seq) - @pytest.mark.parametrize( - "dt", - get_all_dtypes( - no_bool=True, no_none=True, no_complex=True, no_unsigned=True - ), - ) + @pytest.mark.parametrize("dt", get_integer_float_dtypes(no_unsigned=True)) def test_discont(self, dt): a = numpy.array([0, 8, 20, 25, 35, 50], dtype=dt) ia = dpnp.array(a) @@ -2280,9 +2246,7 @@ def test_error(self, func): class TestHypot: - @pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_hypot(self, dtype): a = generate_random_numpy_array(10, dtype, low=0) b = generate_random_numpy_array(10, dtype, low=0) @@ -2347,9 +2311,7 @@ def test_basic(self, dtype, axis, keepdims): assert_dtype_allclose(res, exp) - @pytest.mark.parametrize( - "in_dt", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("in_dt", get_integer_float_dtypes()) @pytest.mark.parametrize("dt", get_all_dtypes(no_bool=True)) def test_dtype(self, in_dt, dt): a = dpnp.ones(100, dtype=in_dt) @@ -2407,9 +2369,7 @@ def test_basic(self, dtype, axis, keepdims): assert_dtype_allclose(res, exp) - @pytest.mark.parametrize( - "in_dt", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) - ) + @pytest.mark.parametrize("in_dt", get_integer_float_dtypes()) @pytest.mark.parametrize("dt", get_all_dtypes(no_bool=True)) def test_dtype(self, in_dt, dt): a = dpnp.ones(99, dtype=in_dt) @@ -2438,9 +2398,7 @@ def test_out(self, in_dt, out_dt): assert_allclose(result, exp, rtol=1e-06) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_none=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_inplace_remainder(dtype): size = 21 a = numpy.arange(size, dtype=dtype) @@ -2452,9 +2410,7 @@ def test_inplace_remainder(dtype): assert_allclose(ia, a) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_bool=True, no_none=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_inplace_floor_divide(dtype): size = 21 a = numpy.arange(size, dtype=dtype) diff --git a/dpnp/tests/test_strides.py b/dpnp/tests/test_strides.py index d51a033bf986..3665fb05c069 100644 --- a/dpnp/tests/test_strides.py +++ b/dpnp/tests/test_strides.py @@ -13,6 +13,7 @@ get_complex_dtypes, get_float_complex_dtypes, get_integer_dtypes, + get_integer_float_dtypes, numpy_version, ) @@ -90,9 +91,7 @@ def test_1arg_support_complex(func, dtype, stride): "unwrap", ], ) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("stride", [2, -1, -3]) def test_1arg(func, dtype, stride): x = generate_random_numpy_array(10, dtype=dtype) @@ -112,9 +111,7 @@ def test_1arg(func, dtype, stride): @pytest.mark.usefixtures("suppress_divide_invalid_numpy_warnings") -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("stride", [2, -1, -3]) def test_rsqrt(dtype, stride): x = generate_random_numpy_array(10, dtype=dtype) @@ -125,9 +122,7 @@ def test_rsqrt(dtype, stride): assert_dtype_allclose(result, expected) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("stride", [2, -1, -3]) def test_logsumexp(dtype, stride): x = generate_random_numpy_array(10, dtype=dtype) @@ -141,9 +136,7 @@ def test_logsumexp(dtype, stride): assert_dtype_allclose(result, expected, check_only_type_kind=flag) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("stride", [2, -1, -3]) def test_cumlogsumexp(dtype, stride): x = generate_random_numpy_array(10, dtype=dtype) @@ -157,9 +150,7 @@ def test_cumlogsumexp(dtype, stride): assert_dtype_allclose(result, expected, check_only_type_kind=flag) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.parametrize("stride", [2, -1, -3]) def test_reduce_hypot(dtype, stride): x = generate_random_numpy_array(10, dtype=dtype) @@ -175,12 +166,8 @@ def test_reduce_hypot(dtype, stride): @pytest.mark.parametrize( "dtype", - get_all_dtypes( - no_none=True, - no_bool=True, - no_complex=True, - no_unsigned=True, - xfail_dtypes=[dpnp.int8, dpnp.int16], + get_integer_float_dtypes( + no_unsigned=True, xfail_dtypes=[dpnp.int8, dpnp.int16] ), ) def test_erf(dtype): @@ -235,9 +222,7 @@ def test_angle(dtype, stride): "subtract", ], ) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) @pytest.mark.usefixtures("suppress_divide_invalid_numpy_warnings") def test_2args(func, dtype): # Integers to negative integer powers are not allowed @@ -269,9 +254,7 @@ def test_bitwise(func, dtype): assert_array_equal(result, expected, strict=True) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_integer_float_dtypes()) def test_copysign(dtype): a = generate_random_numpy_array((3, 3), dtype=dtype) ia = dpnp.array(a) @@ -283,9 +266,7 @@ def test_copysign(dtype): @pytest.mark.parametrize("func", ["fmod", "true_divide", "remainder"]) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True, no_complex=True)) def test_division(func, dtype): a = generate_random_numpy_array((3, 3), dtype=dtype) ia = dpnp.array(a) @@ -298,9 +279,7 @@ def test_division(func, dtype): @pytest.mark.usefixtures("suppress_invalid_numpy_warnings") @pytest.mark.parametrize("func", ["add", "multiply", "power", "subtract"]) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True, no_bool=True)) def test_2args_out(func, dtype): shape = (5, 3, 2) out = numpy.empty(shape, dtype=dtype)[::3] @@ -319,9 +298,7 @@ def test_2args_out(func, dtype): @pytest.mark.usefixtures("suppress_invalid_numpy_warnings") @pytest.mark.parametrize("func", ["add", "multiply", "power", "subtract"]) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True, no_bool=True)) def test_2args_in_out(func, dtype): sh = (3, 4, 2) out = numpy.empty(sh, dtype=dtype)[::2] @@ -341,9 +318,7 @@ def test_2args_in_out(func, dtype): @pytest.mark.parametrize("func", ["add", "multiply", "power", "subtract"]) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True, no_bool=True)) @pytest.mark.skip("dpctl doesn't support type mismatch of out array") def test_2args_in_out_diff_out_dtype(func, dtype): sh = (3, 3, 2) @@ -366,9 +341,7 @@ def test_2args_in_out_diff_out_dtype(func, dtype): @pytest.mark.usefixtures("suppress_invalid_numpy_warnings") @pytest.mark.parametrize("func", ["add", "multiply", "power", "subtract"]) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True, no_bool=True)) def test_2args_in_overlap(func, dtype): size = 5 # Integers to negative integer powers are not allowed @@ -386,9 +359,7 @@ def test_2args_in_overlap(func, dtype): @pytest.mark.usefixtures("suppress_invalid_numpy_warnings") @pytest.mark.parametrize("func", ["add", "multiply", "power", "subtract"]) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True, no_bool=True)) def test_2args_in_out_overlap(func, dtype): a = generate_random_numpy_array((4, 3, 2), dtype=dtype) b = numpy.full(a[::2].shape, fill_value=0.7, dtype=dtype) diff --git a/dpnp/tests/test_sum.py b/dpnp/tests/test_sum.py index 7197c5456f71..68dd14ab7fdf 100644 --- a/dpnp/tests/test_sum.py +++ b/dpnp/tests/test_sum.py @@ -65,9 +65,7 @@ def test_sum_empty_out(dtype): assert_array_equal(out, numpy.array(0, dtype=dtype)) -@pytest.mark.parametrize( - "dtype", get_all_dtypes(no_none=True, no_bool=True, no_complex=True) -) +@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True)) @pytest.mark.parametrize("axis", [None, 0, 1, 2, 3]) def test_sum_empty(dtype, axis): a = numpy.empty((1, 2, 0, 4), dtype=dtype)