Disable deadline in hypothesis profiles

The deadline was not being overridden as described in the README, as the
default profile is not mutable. This registers an additional CI profile
disabling the deadline.
This commit is contained in:
Correl Roush 2021-01-13 16:55:03 -05:00
parent c7cc5ab05d
commit 2b57d71113
2 changed files with 7 additions and 4 deletions

View file

@ -125,7 +125,7 @@ take a long time to run on slower computers. Two profiles are defined for
Hypothesis to use which can be selected by setting the ``HYPOTHESIS_PROFILE``
environment variable to one of the following values:
``default``
``ci``
Runs tests using the default Hypothesis settings (100 examples per test) and
no completion deadline.

View file

@ -2,6 +2,9 @@ import os
from hypothesis import settings
settings(deadline=None)
settings.register_profile("dev", max_examples=10)
settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "default"))
settings.register_profile("ci", deadline=None)
settings.register_profile("dev", deadline=None, max_examples=10)
settings.load_profile(
os.getenv("HYPOTHESIS_PROFILE", "ci" if os.getenv("CI") else "default")
)