Skip to content

Commit 6d64431

Browse files
committed
Resolve failures in tests running towards numpy 2.0
1 parent 37e9176 commit 6d64431

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

dpnp/tests/test_manipulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def test_ndarray(self):
11051105
result = ia.reshape((2, 5))
11061106
assert_array_equal(result, expected)
11071107

1108-
@testing.with_requires("numpy>=2.0")
1108+
@testing.with_requires("numpy>=2.1")
11091109
def test_copy(self):
11101110
a = numpy.arange(10).reshape(2, 5)
11111111
ia = dpnp.array(a)

dpnp/tests/test_mathematical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2445,10 +2445,10 @@ def test_out(self, func_params, dtype):
24452445

24462446
assert result is dp_out
24472447
# numpy.ceil, numpy.floor, numpy.trunc always return float dtype for
2448-
# NumPy < 2.0.0 while output has the dtype of input for NumPy >= 2.0.0
2448+
# NumPy < 2.1.0 while output has the dtype of input for NumPy >= 2.1.0
24492449
# (dpnp follows the latter behavior except for boolean dtype where it
24502450
# returns int8)
2451-
if numpy_version() < "2.0.0" or dtype == numpy.bool:
2451+
if numpy_version() < "2.1.0" or dtype == numpy.bool:
24522452
check_type = False
24532453
else:
24542454
check_type = True

dpnp/tests/test_strides.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ def test_1arg(func, dtype, stride):
101101
result = getattr(dpnp, func)(ia)
102102
expected = getattr(numpy, func)(a)
103103

104-
# numpy.ceil, numpy.floor, numpy.trunc always return float dtype for NumPy < 2.0.0
105-
# while for NumPy >= 2.0.0, output has the dtype of input (dpnp follows this behavior)
106-
if numpy.lib.NumpyVersion(numpy.__version__) < "2.0.0":
104+
# numpy.ceil, numpy.floor, numpy.trunc always return float dtype for
105+
# NumPy < 2.1.0 while for NumPy >= 2.1.0, output has the dtype of input
106+
# (dpnp follows this behavior)
107+
if numpy_version() < "2.1.0":
107108
check_type = False
108109
else:
109110
check_type = True

0 commit comments

Comments
 (0)