File tree 1 file changed +13
-0
lines changed
hypothesis-python/tests/conjecture 1 file changed +13
-0
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
29
30
from tests .conjecture .common import (
30
31
SOME_LABEL ,
31
32
float_kw ,
@@ -655,3 +656,15 @@ def shrinker(data: ConjectureData):
655
656
656
657
shrinker .fixate_shrink_passes (["lower_duplicated_characters" ])
657
658
assert shrinker .choices == (expected [0 ],) + (0 ,) * gap + (expected [1 ],)
659
+
660
+
661
+ def test_shrinking_one_of_with_same_shape ():
662
+ # This is a covering test for our one_of shrinking logic for the case when
663
+ # 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 )
You can’t perform that action at this time.
0 commit comments