Skip to content

Commit 6e8cda6

Browse files
committed
Filter undefined dtypes in hh.two_mutual_arrays()
1 parent 9edcfcc commit 6e8cda6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

array_api_tests/hypothesis_helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ def two_mutual_arrays(
369369
) -> Tuple[SearchStrategy[Array], SearchStrategy[Array]]:
370370
if not isinstance(dtypes, Sequence):
371371
raise TypeError(f"{dtypes=} not a sequence")
372+
if FILTER_UNDEFINED_DTYPES:
373+
dtypes = [d for d in dtypes if not isinstance(d, _UndefinedStub)]
374+
assert len(dtypes) > 0 # sanity check
372375
mutual_dtypes = shared(mutually_promotable_dtypes(dtypes=dtypes))
373376
mutual_shapes = shared(two_shapes)
374377
arrays1 = xps.arrays(

0 commit comments

Comments
 (0)