Skip to content

Commit ee43ae6

Browse files
committed
Added a comment on why we disable the shrink phase.
Signed-off-by: Anthony Charlton <anthony.charlton@zepben.com>
1 parent c03670e commit ee43ae6

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@
1818
# noinspection PyUnresolvedReferences
1919
from .network_fixtures import *
2020

21+
#
22+
# NOTE: Hypothesis is very helpful and wants to give you as much information to help you narrow down any issues as it
23+
# possibly can. The unfortunate side effect of this is when:
24+
# * you have a very large object being generated for you test (OK, it doesn't need to be that large).
25+
# * your test can't ever succeed (that bug you introduced and the reason you have a test in the first place).
26+
#
27+
# Hypothesis, in its infinite wisdom, spends your entire Pytest time budget trying to come up with an example of
28+
# your test passing. The intent is to give you a better error message. The outcome is you loose all details of
29+
# why the test failed, and get a Pytest timeout instead (after waiting of course).
30+
#
31+
# To prevent this, we skip the Hypothesis shrink phase. This means you will have to put up with only getting a
32+
# single example of where the test failed, with a call stack that tells you where this was, and a massive speed
33+
# improvement in all failing tests...
34+
#
2135
no_shrink_phases = [p for p in Phase if p != Phase.shrink]
2236

2337
settings.register_profile("ci", max_examples=1000, phases=no_shrink_phases)

0 commit comments

Comments
 (0)