Skip to content

Commit

Permalink
Disable hypothesis.HealthCheck.too_slow globally
Browse files Browse the repository at this point in the history
Fixes #364
  • Loading branch information
hynek committed Jun 17, 2018
1 parent 908cb01 commit 071dc17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

import pytest

from hypothesis import HealthCheck, settings


def pytest_configure(config):
# HealthCheck.too_slow causes more trouble than good -- especially in CIs.
settings.register_profile(
"patience", settings(suppress_health_check=[HealthCheck.too_slow])
)
settings.load_profile("patience")


@pytest.fixture(scope="session")
def C():
Expand Down
5 changes: 1 addition & 4 deletions tests/test_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import pytest

from hypothesis import HealthCheck, assume, given, settings
from hypothesis import assume, given
from hypothesis import strategies as st

import attr
Expand Down Expand Up @@ -67,7 +67,6 @@ def test_nested_dicts(self, C):
assert {"x": {1: {2: {"x": 1, "y": 2}}}, "y": None} == asdict(outer)

@given(nested_classes, st.sampled_from(MAPPING_TYPES))
@settings(suppress_health_check=[HealthCheck.too_slow])
def test_recurse_property(self, cls, dict_class):
"""
Property tests for recursive asdict.
Expand Down Expand Up @@ -196,7 +195,6 @@ def test_recurse(self, C, tuple_factory):
) == astuple(C(C(1, 2), C(3, 4)), tuple_factory=tuple_factory)

@given(nested_classes, st.sampled_from(SEQUENCE_TYPES))
@settings(suppress_health_check=[HealthCheck.too_slow])
def test_recurse_property(self, cls, tuple_class):
"""
Property tests for recursive astuple.
Expand All @@ -215,7 +213,6 @@ def assert_proper_tuple_class(obj, obj_tuple):
assert_proper_tuple_class(obj, obj_tuple)

@given(nested_classes, st.sampled_from(SEQUENCE_TYPES))
@settings(suppress_health_check=[HealthCheck.too_slow])
def test_recurse_retain(self, cls, tuple_class):
"""
Property tests for asserting collection types are retained.
Expand Down

0 comments on commit 071dc17

Please sign in to comment.