Skip to content

Commit 00fd02a

Browse files
committed
Add a w/a to test for numpy.insert
1 parent 359e933 commit 00fd02a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

dpnp/tests/test_manipulation.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
import numpy
55
import pytest
66
from dpctl.tensor._numpy_helper import AxisError
7-
from numpy.testing import assert_array_equal, assert_equal, assert_raises
7+
from numpy.testing import (
8+
assert_array_equal,
9+
assert_equal,
10+
assert_raises,
11+
numpy_version,
12+
)
813

914
import dpnp
1015

@@ -579,6 +584,11 @@ def test_ndarray_obj_values(self, obj, values):
579584
[True, [False], numpy.array([True] * 4), [True, False, True, False]],
580585
)
581586
def test_boolean_obj(self, obj):
587+
if numpy_version() >= "2.2.0" and not isinstance(numpy.ndarray):
588+
# numpy.insert raises exception
589+
# TODO: remove once NumPy resolves that
590+
obj = numpy.array(obj)
591+
582592
a = numpy.array([1, 2, 3])
583593
ia = dpnp.array(a)
584594
assert_equal(dpnp.insert(ia, obj, 9), numpy.insert(a, obj, 9))

0 commit comments

Comments
 (0)