Skip to content

Commit dce0865

Browse files
authored
tests: disable hypothesis too_slow health check (DataDog#3076)
* tests: disable hypothesis too_slow health check We have tests which are flaky because of this health check. While we do not want tests to be too slow, we don't need to fail the tests if it is slow * remove extra blank line * add hypothesis as global dep in tox
1 parent d02133a commit dce0865

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

conftest.py

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import sys
1111
from time import time
1212

13+
import hypothesis
1314
import pytest
1415

1516

@@ -18,6 +19,11 @@
1819

1920
PY_DIR_PATTERN = re.compile(r"^py[23][0-9]$")
2021

22+
# Disable the "too slow" health checks. We are ok if data generation is slow
23+
# https://hypothesis.readthedocs.io/en/latest/healthchecks.html#hypothesis.HealthCheck.too_slow
24+
hypothesis.settings.register_profile("default", suppress_health_check=(hypothesis.HealthCheck.too_slow,))
25+
hypothesis.settings.load_profile("default")
26+
2127

2228
# Hook for dynamic configuration of pytest in CI
2329
# https://docs.pytest.org/en/6.2.1/reference.html#pytest.hookspec.pytest_configure

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ deps =
9494
opentracing
9595
# test dependencies installed in all envs
9696
mock
97+
hypothesis
9798
# used to test our custom msgpack encoder
9899
profile: pytest-benchmark
99100
py{27,35,36,37,38,39}-profile: uwsgi

0 commit comments

Comments
 (0)