Skip to content

Commit

Permalink
Dogfooding the explain phase
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Aug 20, 2022
1 parent fa23c23 commit fb0855d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions hypothesis-python/tests/common/setup.py
Expand Up @@ -12,7 +12,7 @@
from tempfile import mkdtemp
from warnings import filterwarnings

from hypothesis import Verbosity, settings
from hypothesis import Phase, Verbosity, settings
from hypothesis._settings import not_set
from hypothesis.configuration import set_hypothesis_home_dir
from hypothesis.errors import NonInteractiveExampleWarning
Expand Down Expand Up @@ -66,7 +66,11 @@ def run():
)

settings.register_profile(
"default", settings(max_examples=20 if IN_COVERAGE_TESTS else not_set)
"default",
settings(
max_examples=20 if IN_COVERAGE_TESTS else not_set,
phases=list(Phase), # Dogfooding the explain phase
),
)

settings.register_profile("speedy", settings(max_examples=5))
Expand Down
3 changes: 2 additions & 1 deletion hypothesis-python/tests/cover/test_phases.py
Expand Up @@ -11,6 +11,7 @@
import pytest

from hypothesis import Phase, example, given, settings, strategies as st
from hypothesis._settings import all_settings
from hypothesis.database import ExampleDatabase, InMemoryExampleDatabase
from hypothesis.errors import InvalidArgument

Expand Down Expand Up @@ -47,7 +48,7 @@ def test_sorts_and_dedupes_phases(arg, expected):


def test_phases_default_to_all_except_explain():
assert settings().phases + (Phase.explain,) == tuple(Phase)
assert all_settings["phases"].default + (Phase.explain,) == tuple(Phase)


def test_does_not_reuse_saved_examples_if_reuse_not_in_phases():
Expand Down
2 changes: 1 addition & 1 deletion hypothesis-python/tests/cover/test_settings.py
Expand Up @@ -464,7 +464,7 @@ def __repr__(self):


def test_show_changed():
s = settings(max_examples=999, database=None)
s = settings(max_examples=999, database=None, phases=tuple(Phase)[:-1])
assert s.show_changed() == "database=None, max_examples=999"


Expand Down

0 comments on commit fb0855d

Please sign in to comment.