Skip to content

Commit 71abb2a

Browse files
committed
Fix performance warning in thread
This error now gets surfaced as exception by pytest. For some reason, data generation is too slow even with very conservative parameters.
1 parent 7edec74 commit 71abb2a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

hypothesis-python/tests/nocover/test_recursive.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import threading
1212

13-
from hypothesis import given, settings, strategies as st
13+
from hypothesis import HealthCheck, given, settings, strategies as st
1414

1515
from tests.common.debug import find_any, minimal
1616
from tests.common.utils import flaky
@@ -128,11 +128,15 @@ def test_can_form_sets_of_recursive_data():
128128

129129

130130
def test_drawing_from_recursive_strategy_is_thread_safe():
131-
shared_strategy = st.recursive(st.integers(), lambda s: st.lists(s, max_size=3))
131+
shared_strategy = st.recursive(
132+
st.integers(), lambda s: st.lists(s, max_size=2), max_leaves=20
133+
)
132134

133135
errors = []
134136

135-
@settings(database=None)
137+
@settings(
138+
database=None, deadline=None, suppress_health_check=[HealthCheck.too_slow]
139+
)
136140
@given(data=st.data())
137141
def test(data):
138142
try:

0 commit comments

Comments
 (0)