Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable hypothesis.HealthCheck.too_slow globally #396

Merged
merged 2 commits into from
Jun 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/364.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The test suite now runs with ``hypothesis.HealthCheck.too_slow`` disabled to prevent CI breakage on slower computers.
1 change: 1 addition & 0 deletions changelog.d/396.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The test suite now runs with ``hypothesis.HealthCheck.too_slow`` disabled to prevent CI breakage on slower computers.
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