Skip to content

Commit 390b795

Browse files
committed
ENH: draw int scalars too for x2 when x1 is a float array
1 parent 94861f7 commit 390b795

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

array_api_tests/test_searching_functions.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,9 @@ def test_searchsorted_with_scalars(data):
316316
kw = data.draw(hh.kwargs(side=st.sampled_from(["left", "right"])))
317317

318318
# 2. draw x2, a real-valued scalar
319-
# TODO: draw x2 of promotion compatible dtype (int for float x1 etc) -- cf gh-364
320-
x2 = data.draw(hh.scalars(st.just(x1.dtype), finite=True))
319+
# NB: for a float-dtype x1 array, draw python ints or floats
320+
x2 = data.draw(hh.scalars(st.sampled_from([x1.dtype, xp.int32]), finite=True))
321+
321322

322323
# 3. testing: similar to test_searchsorted, modulo `out.shape == ()`
323324
repro_snippet = ph.format_snippet(

0 commit comments

Comments
 (0)