From 15f95f63ee5b5bc789cc777b3a13d751dcbdd974 Mon Sep 17 00:00:00 2001 From: Stuart Cook Date: Sat, 29 May 2021 18:45:36 +1000 Subject: [PATCH] Fix flaky failure of `test_can_run_with_no_db` --- hypothesis-python/tests/cover/test_stateful.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hypothesis-python/tests/cover/test_stateful.py b/hypothesis-python/tests/cover/test_stateful.py index c8d6492ce7..7fa789c31d 100644 --- a/hypothesis-python/tests/cover/test_stateful.py +++ b/hypothesis-python/tests/cover/test_stateful.py @@ -24,6 +24,7 @@ from hypothesis.control import current_build_context from hypothesis.database import ExampleDatabase from hypothesis.errors import DidNotReproduce, Flaky, InvalidArgument, InvalidDefinition +from hypothesis.internal.entropy import deterministic_PRNG from hypothesis.stateful import ( Bundle, RuleBasedStateMachine, @@ -384,8 +385,9 @@ def test_saves_failing_example_in_database(): def test_can_run_with_no_db(): - with raises(AssertionError): - run_state_machine_as_test(DepthMachine, settings=Settings(database=None)) + with deterministic_PRNG(): + with raises(AssertionError): + run_state_machine_as_test(DepthMachine, settings=Settings(database=None)) def test_stateful_double_rule_is_forbidden(recwarn):