diff --git a/hypothesis-python/tests/quality/test_float_shrinking.py b/hypothesis-python/tests/quality/test_float_shrinking.py index 7beccc2f65..415746f9ff 100644 --- a/hypothesis-python/tests/quality/test_float_shrinking.py +++ b/hypothesis-python/tests/quality/test_float_shrinking.py @@ -10,14 +10,7 @@ import pytest -from hypothesis import ( - HealthCheck, - Verbosity, - example, - given, - settings, - strategies as st, -) +from hypothesis import example, given, strategies as st from hypothesis.internal.compat import ceil from tests.common.debug import minimal @@ -39,21 +32,16 @@ def test_can_shrink_in_variable_sized_context(n): @example(1.7976931348623157e308) @example(1.5) @given(st.floats(min_value=0, allow_infinity=False, allow_nan=False)) -@settings(deadline=None, suppress_health_check=list(HealthCheck)) def test_shrinks_downwards_to_integers(f): - g = minimal( - st.floats().filter(lambda x: x >= f), - settings=settings(verbosity=Verbosity.quiet, max_examples=10**6), - ) - assert g == ceil(f) + assert minimal(st.floats(min_value=f)) == ceil(f) @example(1) @given(st.integers(1, 2**16 - 1)) -@settings(deadline=None, suppress_health_check=list(HealthCheck), max_examples=10) def test_shrinks_downwards_to_integers_when_fractional(b): g = minimal( - st.floats().filter(lambda x: b < x < 2**53 and int(x) != x), - settings=settings(verbosity=Verbosity.quiet, max_examples=10**6), + st.floats( + min_value=b, max_value=2**53, exclude_min=True, exclude_max=True + ).filter(lambda x: int(x) != x) ) assert g == b + 0.5