Skip to content

Commit cd7e741

Browse files
committed
Add changes from the latest version of third party tests
1 parent 3d44bbd commit cd7e741

File tree

7 files changed

+14
-16
lines changed

7 files changed

+14
-16
lines changed

dpnp/tests/third_party/cupy/core_tests/test_dlpack.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,21 @@ def test_conversion_device(self):
142142
testing.assert_array_equal(orig_array, out_array)
143143
assert orig_array.get_array()._pointer == out_array.get_array()._pointer
144144

145-
@pytest.mark.skip("no BufferError exception for bad device")
146145
def test_conversion_bad_device(self):
147146
arr = _gen_array("float32")
148147

149148
# invalid device ID
150149
with pytest.raises(BufferError):
151-
arr.__dlpack__(dl_device=(arr.__dlpack_device__()[0], 2**30))
150+
arr.__dlpack__(
151+
dl_device=(arr.__dlpack_device__()[0], 2**30),
152+
max_version=(1, 0),
153+
)
152154

153155
# Simple, non-matching device:
154156
with pytest.raises(BufferError):
155-
arr.__dlpack__(dl_device=(9, 0))
157+
arr.__dlpack__(dl_device=(9, 0), max_version=(1, 0))
156158

157-
@pytest.mark.skip("not supported conversion to CPU")
159+
@pytest.mark.skip("numpy doesn't support kDLOneAPI device type")
158160
def test_conversion_device_to_cpu(self):
159161
# NOTE: This defaults to the old unversioned, which is needed for
160162
# NumPy 1.x support.

dpnp/tests/third_party/cupy/manipulation_tests/test_basic.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,7 @@ def test_copyto_where(self, xp, dtype):
231231
return dst
232232

233233

234-
@pytest.mark.skipif(
235-
numpy.__version__ < "2",
236-
reason="XXX: NP2.0: copyto is in flux in numpy 2.0.0rc2",
237-
)
234+
@testing.with_requires("numpy>=2.1")
238235
@pytest.mark.parametrize(
239236
"casting", ["no", "equiv", "safe", "same_kind", "unsafe"]
240237
)

dpnp/tests/third_party/cupy/math_tests/test_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_clip_max_none(self, xp, dtype):
122122
a = testing.shaped_arange((2, 3, 4), xp, dtype)
123123
return a.clip(3, None)
124124

125-
@testing.with_requires("numpy>=2.0")
125+
@testing.with_requires("numpy>=2.1")
126126
@testing.for_all_dtypes(no_bool=True, no_complex=True)
127127
@testing.numpy_cupy_array_equal()
128128
def test_clip_min_max_none(self, xp, dtype):

dpnp/tests/third_party/cupy/math_tests/test_rounding.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,22 @@ def test_rint_negative(self):
5151
self.check_unary_negative("rint")
5252
self.check_unary_negative_complex("rint")
5353

54+
@testing.with_requires("numpy>=2.1")
5455
def test_floor(self):
5556
self.check_unary("floor")
5657
self.check_unary_complex_unsupported("floor")
5758

59+
@testing.with_requires("numpy>=2.1")
5860
def test_ceil(self):
5961
self.check_unary("ceil")
6062
self.check_unary_complex_unsupported("ceil")
6163

64+
@testing.with_requires("numpy>=2.1")
6265
def test_trunc(self):
6366
self.check_unary("trunc")
6467
self.check_unary_complex_unsupported("trunc")
6568

69+
@testing.with_requires("numpy>=2.1")
6670
def test_fix(self):
6771
self.check_unary("fix")
6872
self.check_unary_complex_unsupported("fix")

dpnp/tests/third_party/cupy/random_tests/test_generator.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -980,11 +980,6 @@ def test_randint_float1(self):
980980
def test_randint_float2(self):
981981
self.generate(6.7, size=(2, 3))
982982

983-
@pytest.mark.xfail(
984-
numpy.__version__ < "2",
985-
reason="XXX: np 2.0: comparisons with OOB "
986-
"ints are broken in numpy < 2",
987-
)
988983
def test_randint_int64_1(self):
989984
self.generate(2**34, 2**40, 3, dtype="q")
990985

dpnp/tests/third_party/cupy/statistics_tests/test_meanvar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def test_external_mean_axis(self, xp, dtype):
235235
@testing.for_all_dtypes(no_complex=True)
236236
@testing.numpy_cupy_allclose(rtol=1e-06)
237237
def test_mean_all_float32_dtype(self, xp, dtype):
238-
a = xp.full((2, 3, 4), 123456789, dtype=dtype)
238+
a = testing.shaped_arange((2, 3, 4), xp, dtype=dtype)
239239
return xp.mean(a, dtype=numpy.float32)
240240

241241
@testing.for_all_dtypes(no_complex=True)

dpnp/tests/third_party/cupy/statistics_tests/test_order.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def test_quantile_unexpected_method(self, dtype):
7878

7979

8080
@pytest.mark.skip("dpnp.quantile() is not implemented yet")
81-
@testing.with_requires("numpy>=1.22.0rc1")
81+
@testing.with_requires("numpy>=2.0")
8282
@for_all_methods()
8383
class TestQuantileMethods:
8484

0 commit comments

Comments
 (0)