Skip to content

Commit 2b60988

Browse files
committed
Cover axis in test_flip
1 parent 388920b commit 2b60988

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

array_api_tests/test_manipulation_functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from . import hypothesis_helpers as hh
1313
from . import pytest_helpers as ph
1414
from . import xps
15+
from .test_statistical_functions import axes_ndindex, normalise_axis # TODO: Move
1516
from .typing import Array, Shape
1617

1718
MAX_SIDE = hh.MAX_ARRAY_SIZE // 64
@@ -210,9 +211,8 @@ def test_flip(x, data):
210211

211212
ph.assert_dtype("flip", x.dtype, out.dtype)
212213

213-
# TODO: test all axis scenarios
214-
if kw.get("axis", None) is None:
215-
indices = list(ah.ndindex(x.shape))
214+
_axes = normalise_axis(kw.get("axis", None), x.ndim)
215+
for indices in axes_ndindex(x.shape, _axes):
216216
reverse_indices = indices[::-1]
217217
assert_array_ndindex("flip", x, indices, out, reverse_indices)
218218

0 commit comments

Comments
 (0)