Skip to content

Commit eaa79fa

Browse files
committed
Mute test_trim_zero_dim since now supported by numpy 2.2
1 parent f55d515 commit eaa79fa

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

dpnp/tests/test_manipulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def test_ndarray_obj_values(self, obj, values):
584584
[True, [False], numpy.array([True] * 4), [True, False, True, False]],
585585
)
586586
def test_boolean_obj(self, obj):
587-
if numpy_version() >= "2.2.0" and not isinstance(numpy.ndarray):
587+
if numpy_version() >= "2.2.0" and not isinstance(obj, numpy.ndarray):
588588
# numpy.insert raises exception
589589
# TODO: remove once NumPy resolves that
590590
obj = numpy.array(obj)

dpnp/tests/test_statistics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,8 @@ def test_false_rowvar(self, dtype):
623623

624624
# numpy 2.2 properly transposes 2d array when rowvar=False
625625
@with_requires("numpy>=2.2")
626-
def test_1D_false_rowvar(self):
627-
a = numpy.array([0, 1, 2])
626+
def test_false_rowvar(self):
627+
a = numpy.array([[0, 1, 2]])
628628
ia = dpnp.array(a)
629629

630630
expected = numpy.cov(a, rowvar=False)
@@ -633,7 +633,8 @@ def test_1D_false_rowvar(self):
633633

634634
# numpy 2.2 properly transposes 2d array when rowvar=False
635635
@with_requires("numpy>=2.2")
636-
def test_2D_rowvar(self):
636+
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
637+
def test_true_rowvar(self):
637638
a = numpy.ones((3, 1))
638639
ia = dpnp.array(a)
639640

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ def test_trim_back_zeros(self, xp, dtype):
387387
a = xp.array([1, 0, 2, 3, 0, 5, 0, 0, 0], dtype=dtype)
388388
return xp.trim_zeros(a, trim=self.trim)
389389

390+
# TODO: remove once SAT-7616
391+
@testing.with_requires("numpy<2.2")
390392
@testing.for_all_dtypes()
391393
def test_trim_zero_dim(self, dtype):
392394
for xp in (numpy, cupy):

0 commit comments

Comments
 (0)