Skip to content

Commit 7180fe5

Browse files
authored
Unmuted tests from test_mathematical.py scope (#1668)
* Unmuted tests from test_mathematical.py scope * Removed fallback fixture for dpnp.copysign * Tests for dpnp.clip with NaN edges require numpy>=1.25.0 * Muted again power tests with complex types (until 2024.1 release)
1 parent 8cde6c4 commit 7180fe5

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

tests/test_mathematical.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import dpnp
1717
from dpnp.dpnp_array import dpnp_array
18+
from tests.third_party.cupy import testing
1819

1920
from .helper import (
2021
assert_dtype_allclose,
@@ -25,7 +26,6 @@
2526
get_integer_dtypes,
2627
has_support_aspect64,
2728
is_cpu_device,
28-
is_win_platform,
2929
)
3030

3131

@@ -125,8 +125,7 @@ def test_input_nan(self):
125125
expected = numpy.clip(np_a, -1, 1)
126126
assert_array_equal(result, expected)
127127

128-
# TODO: unmute the test once dpctl resolves the issue
129-
@pytest.mark.skip(reason="dpctl-1489 issue")
128+
@testing.with_requires("numpy>=1.25.0")
130129
@pytest.mark.parametrize(
131130
"kwargs",
132131
[
@@ -138,7 +137,7 @@ def test_input_nan(self):
138137
],
139138
)
140139
def test_nan_edges(self, kwargs):
141-
np_a = numpy.arange(7)
140+
np_a = numpy.arange(7.0)
142141
dp_a = dpnp.asarray(np_a)
143142

144143
result = dp_a.clip(**kwargs)
@@ -424,7 +423,6 @@ def test_add(self, dtype, lhs, rhs):
424423
def test_arctan2(self, dtype, lhs, rhs):
425424
self._test_mathematical("arctan2", dtype, lhs, rhs)
426425

427-
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
428426
@pytest.mark.parametrize(
429427
"dtype", get_all_dtypes(no_bool=True, no_complex=True)
430428
)
@@ -564,7 +562,7 @@ def test_op_with_scalar(array, val, func, data_type, val_type):
564562
pytest.skip(
565563
"(0j ** 0) is different: (NaN + NaNj) in dpnp and (1 + 0j) in numpy"
566564
)
567-
# TODO: Remove when #1378 (dpctl) is solved
565+
# TODO: Remove when #1378 (dpctl) is solved and 2024.1 is released (coverage is failing otherwise)
568566
elif (
569567
is_cpu_device()
570568
and dpnp_a.dtype == dpnp.complex128
@@ -1002,7 +1000,7 @@ def test_power(array, val, data_type, val_type):
10021000
dpnp_a = dpnp.array(array, dtype=data_type)
10031001
val_ = val_type(val)
10041002

1005-
# TODO: Remove when #1378 (dpctl) is solved
1003+
# TODO: Remove when #1378 (dpctl) is solved and 2024.1 is released (coverage is failing otherwise)
10061004
if (
10071005
is_cpu_device()
10081006
and (
@@ -2306,12 +2304,6 @@ def test_complex_values(self):
23062304
dp_arr = dpnp.array(np_arr)
23072305
func = lambda x: x**2
23082306

2309-
# TODO: unmute the test once it's available
2310-
if is_win_platform():
2311-
pytest.skip(
2312-
"Until the latest dpctl is available on internal channel"
2313-
)
2314-
23152307
assert_dtype_allclose(func(dp_arr), func(np_arr))
23162308

23172309
@pytest.mark.parametrize("val", [0, 1], ids=["0", "1"])
@@ -2696,9 +2688,6 @@ def test_matmul_dtype_matrix_inputs(self, dtype1, dtype2, shape_pair):
26962688
with pytest.raises(TypeError):
26972689
dpnp.matmul(b1, b2, dtype=dtype2)
26982690

2699-
# TODO: Temporary skipping the test, until Internal CI is updated with
2700-
# recent changed in dpctl regarding dpt.result_type function
2701-
@pytest.mark.skip("Temporary skipping the test")
27022691
@pytest.mark.parametrize("dtype1", get_all_dtypes(no_bool=True))
27032692
@pytest.mark.parametrize("dtype2", get_all_dtypes(no_bool=True))
27042693
@pytest.mark.parametrize(
@@ -2846,9 +2835,6 @@ def test_exe_q(self):
28462835
with pytest.raises(ValueError):
28472836
dpnp.matmul(x1, x2)
28482837

2849-
# TODO: Temporary skipping the test, until Internal CI is updated with
2850-
# recent changed in dpctl regarding dpt.result_type function
2851-
@pytest.mark.skip("Temporary skipping the test")
28522838
def test_matmul_casting(self):
28532839
a1 = dpnp.arange(2 * 4, dtype=dpnp.float32).reshape(2, 4)
28542840
a2 = dpnp.arange(4 * 3).reshape(4, 3)

0 commit comments

Comments
 (0)