Skip to content

Commit f413d8c

Browse files
honnoZac-HD
andcommitted
Deterministic error message for no-fill, multi-types path
Co-authored-by: Zac Hatfield-Dodds <[email protected]>
1 parent 88e6792 commit f413d8c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎hypothesis-python/src/hypothesis/extra/array_api.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ def do_draw(self, data):
303303
f_elems = str(elems)
304304
else:
305305
f_elems = f"[{elems[0]}, {elems[1]}, ..., {elems[-2]}, {elems[-1]}]"
306-
types = tuple({type(e) for e in elems})
306+
types = tuple(
307+
sorted({type(e) for e in elems}, key=lambda t: t.__name__)
308+
)
307309
f_types = f"type {types[0]}" if len(types) == 1 else f"types {types}"
308310
raise InvalidArgument(
309311
f"Generated elements {f_elems} from strategy "

0 commit comments

Comments
 (0)