Skip to content

Commit 794ef30

Browse files
committed
Pass stop and step as pos args in test_arange
1 parent f7fc94b commit 794ef30

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

array_api_tests/test_creation_functions.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,8 @@ def test_arange(dtype, data):
131131
size <= hh.MAX_ARRAY_SIZE
132132
), f"{size=} should be no more than {hh.MAX_ARRAY_SIZE}" # sanity check
133133

134-
kw = data.draw(
135-
hh.specified_kwargs(
136-
hh.KVD("stop", stop, None),
137-
hh.KVD("step", step, None),
138-
hh.KVD("dtype", dtype, None),
139-
),
140-
label="kw",
141-
)
142-
out = xp.arange(start, **kw)
134+
kw = data.draw(hh.specified_kwargs(hh.KVD("dtype", dtype, None)), label="kw")
135+
out = xp.arange(start, stop, step, **kw)
143136

144137
if dtype is None:
145138
if all_int:
@@ -149,7 +142,10 @@ def test_arange(dtype, data):
149142
else:
150143
ph.assert_dtype("arange", (out.dtype,), dtype)
151144
assert out.ndim == 1, f"{out.ndim=}, but should be 1 [linspace()]"
152-
f_func = f"[arange({start}, {stop}, {step})]"
145+
if stop is None:
146+
f_func = f"[arange({start}, {step=})]"
147+
else:
148+
f_func = f"[arange({start}, {stop}, {step})]"
153149
# We check size is roughly as expected to avoid edge cases e.g.
154150
#
155151
# >>> xp.arange(2, step=0.333333333333333)

0 commit comments

Comments
 (0)