##// END OF EJS Templates
testing: add a 'continuous' profile...
David R. MacIver -
r28259:7829d0ba default
parent child Browse files
Show More
@@ -41,6 +41,7 b' from hypothesis.stateful import ('
41 rule, RuleBasedStateMachine, Bundle, precondition)
41 rule, RuleBasedStateMachine, Bundle, precondition)
42 from hypothesis import settings, note, strategies as st
42 from hypothesis import settings, note, strategies as st
43 from hypothesis.configuration import set_hypothesis_home_dir
43 from hypothesis.configuration import set_hypothesis_home_dir
44 from hypothesis.database import ExampleDatabase
44
45
45 testdir = os.path.abspath(os.environ["TESTDIR"])
46 testdir = os.path.abspath(os.environ["TESTDIR"])
46
47
@@ -530,6 +531,23 b' class verifyingstatemachine(RuleBasedSta'
530 with acceptableerrors("no shelved changes to apply"):
531 with acceptableerrors("no shelved changes to apply"):
531 self.hg("unshelve")
532 self.hg("unshelve")
532
533
534 class writeonlydatabase(ExampleDatabase):
535 def __init__(self, underlying):
536 super(ExampleDatabase, self).__init__()
537 self.underlying = underlying
538
539 def fetch(self, key):
540 return ()
541
542 def save(self, key, value):
543 self.underlying.save(key, value)
544
545 def delete(self, key, value):
546 self.underlying.delete(key, value)
547
548 def close(self):
549 self.underlying.close()
550
533 settings.register_profile(
551 settings.register_profile(
534 'default', settings(
552 'default', settings(
535 timeout=300,
553 timeout=300,
@@ -548,6 +566,16 b' settings.register_profile('
548 )
566 )
549 )
567 )
550
568
569 settings.register_profile(
570 'continuous', settings(
571 timeout=-1,
572 stateful_step_count=1000,
573 max_examples=10 ** 8,
574 max_iterations=10 ** 8,
575 database=writeonlydatabase(settings.default.database)
576 )
577 )
578
551 settings.load_profile(os.getenv('HYPOTHESIS_PROFILE', 'default'))
579 settings.load_profile(os.getenv('HYPOTHESIS_PROFILE', 'default'))
552
580
553 verifyingtest = verifyingstatemachine.TestCase
581 verifyingtest = verifyingstatemachine.TestCase
General Comments 0
You need to be logged in to leave comments. Login now