File tree 1 file changed +9
-8
lines changed
hypothesis-python/tests/conjecture
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 26
26
from hypothesis .internal .conjecture .utils import Sampler
27
27
from hypothesis .internal .floats import MAX_PRECISE_INTEGER
28
28
29
- from tests .common .debug import minimal
30
29
from tests .conjecture .common import (
31
30
SOME_LABEL ,
32
31
float_kw ,
@@ -661,10 +660,12 @@ def shrinker(data: ConjectureData):
661
660
def test_shrinking_one_of_with_same_shape ():
662
661
# This is a covering test for our one_of shrinking logic for the case when
663
662
# the choice sequence *doesn't* change shape in the newly chosen one_of branch.
664
- #
665
- # There are relatively few tests in our suite that cover this (and previously
666
- # none in the covering subset). I chose the simplest one to copy here, but
667
- # haven't yet put time into extracting the essence of a test case that
668
- # covers this case, which is why we're using st.permutations here instead of
669
- # something more fundamental / obviously testing what we want.
670
- minimal (st .permutations (list (range (5 ))), lambda x : x [0 ] != 0 )
663
+ @shrinking_from ([1 , 0 ])
664
+ def shrinker (data : ConjectureData ):
665
+ n = data .draw_integer (0 , 1 )
666
+ data .draw_integer ()
667
+ if n == 1 :
668
+ data .mark_interesting ()
669
+
670
+ shrinker .initial_coarse_reduction ()
671
+ assert shrinker .choices == (1 , 0 )
You can’t perform that action at this time.
0 commit comments