Skip to content

Commit 0f59c21

Browse files
committed
BUG: avoid generating numpy scalars in test_asarray_arrays
Otherwise, on numpy we can generate a numpy scalar and copy=False, which fails with (Pdb) p np.asarray(np.False_, copy=False) *** ValueError: Unable to avoid copy while creating an array as requested.
1 parent 7c700e7 commit 0f59c21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

array_api_tests/test_creation_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def scalar_eq(s1: Scalar, s2: Scalar) -> bool:
263263
data=st.data(),
264264
)
265265
def test_asarray_arrays(shape, dtypes, data):
266-
x = data.draw(hh.arrays(dtype=dtypes.input_dtype, shape=shape), label="x")
266+
x = data.draw(hh.arrays_no_scalars(dtype=dtypes.input_dtype, shape=shape), label="x")
267267
dtypes_strat = st.just(dtypes.input_dtype)
268268
if dtypes.input_dtype == dtypes.result_dtype:
269269
dtypes_strat |= st.none()

0 commit comments

Comments
 (0)