Skip to content

Commit 25bbbbc

Browse files
committed
Adjust crosshair test expectations for crosshair-tool 0.0.109
Remove the xfail from test_issue_2247_regression: the cross-type float equality bug it tracked is fixed in crosshair-tool 0.0.109, so the strict xfail now fails as XPASS. Add a non-strict xfail to test_fuzzing_floats_bounds: crosshair-tool 0.0.109 can realize a symbolic float to a rational that is not representable as an IEEE double, so converting it to a concrete float rounds to a value the path constraints exclude, and st.floats() bounds validation raises a spurious InvalidArgument. Add a non-strict xfail to test_crosshair_can_hit_a_specific_date: any earlier crosshair-backed test which ran under an observability callback leaves process-global crosshair state that stops this test from finding its target date. This affects 0.0.108 too, but the 0.0.109 timing changes reshuffled pytest-xdist scheduling so CI now hits it. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SgXnKKCvNk6BQK27TvX9kB
1 parent 459b5c7 commit 25bbbbc

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

‎hypothesis/tests/cover/test_float_nastiness.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
)
2727

2828
from tests.common.debug import find_any, minimal
29+
from tests.common.utils import Why, xfail_on_crosshair
2930

3031
try:
3132
import numpy
@@ -259,6 +260,12 @@ def test_cannot_exclude_endpoint_with_zero_interval(lo, hi, exmin, exmax):
259260
WIDTHS = (64, 32, 16)
260261

261262

263+
# crosshair-tool 0.0.109 can realize a symbolic float to a rational that is not
264+
# representable as an IEEE double (e.g. 1 + 2**-1064 when constrained to != 1);
265+
# converting it to a concrete float then rounds to the excluded value, so the
266+
# bounds-validation in st.floats() raises a spurious InvalidArgument. Remove
267+
# once a fixed crosshair-tool is pinned.
268+
@xfail_on_crosshair(Why.other, strict=False)
262269
@pytest.mark.parametrize("nonfloat", [st.nothing(), st.none()])
263270
@given(data=st.data(), width=st.sampled_from(WIDTHS))
264271
def test_fuzzing_floats_bounds(data, width, nonfloat):

‎hypothesis/tests/cover/test_sampled_from.py‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
assert_simple_property,
3535
check_can_generate_examples,
3636
)
37-
from tests.common.utils import Why, fails_with, xfail_on_crosshair
37+
from tests.common.utils import fails_with
3838

3939
an_enum = enum.Enum("A", "a b c")
4040
a_flag = enum.Flag("A", "a b c")
@@ -175,11 +175,6 @@ def test_max_size_is_respected_with_unique_sampled_from(ls):
175175
assert len(ls) <= 3
176176

177177

178-
# crosshair-tool 0.0.108 encodes `==` between a promoted symbolic int and a
179-
# symbolic float as SMT structural equality, under which +0.0 != -0.0; this
180-
# makes the uniqueness check take an infeasible branch and realization then
181-
# raises CrossHairInternal. Remove once a fixed crosshair-tool is pinned.
182-
@xfail_on_crosshair(Why.other)
183178
@given(st.lists(st.sampled_from([0, 0.0]), unique=True, min_size=1))
184179
def test_issue_2247_regression(ls):
185180
assert len(ls) == 1

‎hypothesis/tests/crosshair/test_crosshair.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ def test_event_with_realization(value):
228228
float(value)
229229

230230

231+
# Any earlier crosshair-backed test which ran under an observability callback
232+
# (e.g. test_realizes_event) leaves process-global crosshair state which stops
233+
# this test from finding the failing example. Remove the xfail once that
234+
# state-leak is fixed upstream.
235+
@pytest.mark.xfail(strict=False, reason="observability in a previous test breaks this")
231236
def test_crosshair_can_hit_a_specific_date():
232237
# See https://github.com/HypothesisWorks/hypothesis/issues/4759.
233238
@given(st.dates())

0 commit comments

Comments
 (0)