In spite of specifying maxfail=1
, hypothesis seems to continue generating examples and running them and failing much later.
Is there a workaround?
Here is a small example:
from hypothesis.stateful import invariant, rule, RuleBasedStateMachine
class MaxFail(RuleBasedStateMachine):
count = 0
@rule()
def process(self):
self.count += 1
@invariant()
def all_done(self):
print('-- in invariant %d' % self.count)
if self.count > 1:
assert False
MaxFailTest = MaxFail.TestCase