Skip to content

Commit 80c6046

Browse files
Incorporate gh_1178 test into previous one as suggested by @vtavana
1 parent 7c85781 commit 80c6046

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

dpctl/tests/test_usm_ndarray_manipulation.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -994,27 +994,23 @@ def test_moveaxis_preserve_order(source, destination):
994994

995995

996996
@pytest.mark.parametrize(
997-
"source, destination, expected",
997+
"shape, source, destination, expected",
998998
[
999-
([0, 1], [2, 3], (2, 3, 0, 1)),
1000-
([2, 3], [0, 1], (2, 3, 0, 1)),
1001-
([0, 1, 2], [2, 3, 0], (2, 3, 0, 1)),
1002-
([3, 0], [1, 0], (0, 3, 1, 2)),
1003-
([0, 3], [0, 1], (0, 3, 1, 2)),
999+
((0, 1, 2, 3), [0, 1], [2, 3], (2, 3, 0, 1)),
1000+
((0, 1, 2, 3), [2, 3], [0, 1], (2, 3, 0, 1)),
1001+
((0, 1, 2, 3), [0, 1, 2], [2, 3, 0], (2, 3, 0, 1)),
1002+
((0, 1, 2, 3), [3, 0], [1, 0], (0, 3, 1, 2)),
1003+
((0, 1, 2, 3), [0, 3], [0, 1], (0, 3, 1, 2)),
1004+
((1, 2, 3, 4), range(4), range(4), (1, 2, 3, 4)),
10041005
],
10051006
)
1006-
def test_moveaxis_move_multiples(source, destination, expected):
1007+
def test_moveaxis_move_multiples(shape, source, destination, expected):
10071008
get_queue_or_skip()
1008-
x = dpt.zeros((0, 1, 2, 3))
1009-
actual = dpt.moveaxis(x, source, destination).shape
1009+
x = dpt.zeros(shape)
1010+
y = dpt.moveaxis(x, source, destination)
1011+
actual = y.shape
10101012
assert_(actual, expected)
1011-
1012-
1013-
def test_moveaxis_gh_1178():
1014-
get_queue_or_skip()
1015-
x = dpt.zeros((1, 2, 3, 4))
1016-
y = dpt.moveaxis(x, range(4), range(4))
1017-
assert y.shape == x.shape
1013+
assert y._pointer == x._pointer
10181014

10191015

10201016
def test_moveaxis_errors():

0 commit comments

Comments
 (0)