Skip to content

Commit

Permalink
Update to new settings syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Feb 18, 2024
1 parent ed231ae commit 9e8cb80
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ from hypothesis import note, settings
from hypothesis.stateful import RuleBasedStateMachine, invariant, rule


# The default is not always enough for Hypothesis to find a failing example.
@settings(max_examples=2000)
class DieHardProblem(RuleBasedStateMachine):
small = 0
big = 0
Expand Down Expand Up @@ -112,10 +114,7 @@ class DieHardProblem(RuleBasedStateMachine):
assert self.big != 4


# The default of 200 is sometimes not enough for Hypothesis to find
# a falsifying example.
with settings(max_examples=2000):
DieHardTest = DieHardProblem.TestCase
DieHardTest = DieHardProblem.TestCase
```

Calling `pytest` on this file quickly digs up a solution:
Expand Down

0 comments on commit 9e8cb80

Please sign in to comment.