Skip to content

Commit 92c8d45

Browse files
committed
Fix test_take with keyword-only argument assert functions
1 parent d2d43a7 commit 92c8d45

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

array_api_tests/test_indexing_functions.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ def test_take(x, data):
3232

3333
out = xp.take(x, indices, axis=axis)
3434

35-
ph.assert_dtype("take", x.dtype, out.dtype)
35+
ph.assert_dtype("take", in_dtype=x.dtype, out_dtype=out.dtype)
3636
ph.assert_shape(
3737
"take",
38-
out.shape,
39-
x.shape[:axis] + (len(_indices),) + x.shape[axis + 1 :],
40-
x=x,
41-
indices=indices,
42-
axis=axis,
38+
out_shape=out.shape,
39+
expected=x.shape[:axis] + (len(_indices),) + x.shape[axis + 1 :],
40+
kw=dict(
41+
x=x,
42+
indices=indices,
43+
axis=axis,
44+
),
4345
)
4446
out_indices = sh.ndindex(out.shape)
4547
axis_indices = list(sh.axis_ndindex(x.shape, axis))
@@ -52,10 +54,10 @@ def test_take(x, data):
5254
out_idx = next(out_indices)
5355
ph.assert_0d_equals(
5456
"take",
55-
sh.fmt_idx(f_take_idx, at_idx),
56-
indexed_x[at_idx],
57-
sh.fmt_idx("out", out_idx),
58-
out[out_idx],
57+
x_repr=sh.fmt_idx(f_take_idx, at_idx),
58+
x_val=indexed_x[at_idx],
59+
out_repr=sh.fmt_idx("out", out_idx),
60+
out_val=out[out_idx],
5961
)
6062
# sanity check
6163
with pytest.raises(StopIteration):

0 commit comments

Comments
 (0)