File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ RELEASE_TYPE: patch
2+
3+ Patch files written by hypothesis now use a deterministic ordering when multiple |@example | decorators are present.
Original file line number Diff line number Diff line change @@ -209,7 +209,14 @@ def _get_patch_for(
209209 # The printed examples might include object reprs which are invalid syntax,
210210 # so we parse here and skip over those. If _none_ are valid, there's no patch.
211211 call_nodes : list [tuple [cst .Call , str ]] = []
212- for ex , via in set (examples ):
212+
213+ # we want to preserve order, but remove duplicates.
214+ seen_examples = set ()
215+ for ex , via in examples :
216+ if (ex , via ) in seen_examples :
217+ continue
218+ seen_examples .add ((ex , via ))
219+
213220 with suppress (Exception ):
214221 node : Any = cst .parse_module (ex )
215222 the_call = node .body [0 ].body [0 ].value
You can’t perform that action at this time.
0 commit comments