Skip to content

Commit 6c12d44

Browse files
committed
Add tests to dpnp.ndindex
1 parent 5d612c6 commit 6c12d44

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dpnp/tests/test_indexing.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,18 @@ def test_ix_error(self, xp, shape):
335335
assert_raises(ValueError, xp.ix_, xp.ones(shape))
336336

337337

338+
class TestNdindex:
339+
@pytest.mark.parametrize(
340+
"shape", [[1, 2, 3], [(1, 2, 3)], [(3,)], [3], [], [()], [0]]
341+
)
342+
def test_basic(self, shape):
343+
result = dpnp.ndindex(*shape)
344+
expected = numpy.ndindex(*shape)
345+
346+
for x, y in zip(result, expected):
347+
assert x == y
348+
349+
338350
class TestNonzero:
339351
@pytest.mark.parametrize("list_val", [[], [0], [1]])
340352
def test_trivial(self, list_val):

0 commit comments

Comments
 (0)