diff --git a/tests/test_vector2_isclose.py b/tests/test_vector2_isclose.py index 20a4e3de..fb1e3d7b 100644 --- a/tests/test_vector2_isclose.py +++ b/tests/test_vector2_isclose.py @@ -10,6 +10,8 @@ def test_isclose_to_self(x, abs_tol, rel_tol): assert x.isclose(x, abs_tol=abs_tol, rel_tol=rel_tol) +EPSILON = 1e-8 + @given(x=vectors(), direction=units(), abs_tol=lengths()) def test_isclose_abs_error(x, direction, abs_tol): """Test x.isclose(rel_tol=0) near the boundary between “close” and “not close” @@ -21,7 +23,6 @@ def test_isclose_abs_error(x, direction, abs_tol): error = abs_tol * direction note(f"error = {error}") - EPSILON = 1e-12 positive = x + (1 - EPSILON) * error note(f"positive example: {positive} = x + {positive - x}") assert x.isclose(positive, abs_tol=abs_tol, rel_tol=0) @@ -33,7 +34,6 @@ def test_isclose_abs_error(x, direction, abs_tol): assert not x.isclose(negative, abs_tol=abs_tol, rel_tol=0) -EPSILON = 1e-8 @given(x=vectors(), direction=units(), rel_tol=floats(min_value=EPSILON, max_value=1-EPSILON)) def test_isclose_rel_error(x, direction, rel_tol):