@@ -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
10201016def test_moveaxis_errors ():
0 commit comments