Skip to content

Commit 0b36ade

Browse files
committed
Fix test_roll
1 parent dcd1cfc commit 0b36ade

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

array_api_tests/test_manipulation_functions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ def assert_array_ndindex(
3030
out: Array,
3131
out_indices: Iterable[Union[int, Shape]],
3232
):
33+
msg_suffix = f" [{func_name}()]\n {x=}\n{out=}"
3334
for x_idx, out_idx in zip(x_indices, out_indices):
34-
msg = f"out[{out_idx}]={out[out_idx]}, should be x[{x_idx}]={x[x_idx]} [{func_name}()]"
35+
msg = f"out[{out_idx}]={out[out_idx]}, should be x[{x_idx}]={x[x_idx]}"
36+
msg += msg_suffix
3537
if dh.is_float_dtype(x.dtype) and xp.isnan(x[x_idx]):
3638
assert xp.isnan(out[out_idx]), msg
3739
else:
@@ -229,9 +231,7 @@ def test_roll(x, data):
229231
if isinstance(shift, int) and kw.get("axis", None) is None:
230232
indices = list(ah.ndindex(x.shape))
231233
shifted_indices = deque(indices)
232-
shifted_indices.rotate(shift)
233-
print(f"{indices=}")
234-
print(f"{shifted_indices=}")
234+
shifted_indices.rotate(-shift)
235235
assert_array_ndindex("roll", x, indices, out, shifted_indices)
236236

237237

0 commit comments

Comments
 (0)