Skip to content

Commit ca4297b

Browse files
committed
de-flake coverage
fixes #3968, for good this time
1 parent 88c80f7 commit ca4297b

File tree

2 files changed

+2
-18
lines changed
  • hypothesis-python/src/hypothesis

2 files changed

+2
-18
lines changed

hypothesis-python/src/hypothesis/extra/pandas/impl.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ def data_frames(
534534
def rows_only(draw):
535535
index = draw(index_strategy)
536536

537-
@check_function
538537
def row():
539538
result = draw(rows)
540539
check_type(abc.Iterable, result, "draw(row)")

hypothesis-python/src/hypothesis/strategies/_internal/core.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
is_typed_named_tuple,
8484
)
8585
from hypothesis.internal.conjecture.utils import calc_label_from_cls, check_sample
86-
from hypothesis.internal.coverage import IN_COVERAGE_TESTS, description_stack
8786
from hypothesis.internal.entropy import get_seeder_and_restorer
8887
from hypothesis.internal.floats import float_of
8988
from hypothesis.internal.observability import TESTCASE_CALLBACKS
@@ -1758,22 +1757,8 @@ def __init__(self, definition, args, kwargs):
17581757
self.args = args
17591758
self.kwargs = kwargs
17601759

1761-
if IN_COVERAGE_TESTS:
1762-
# We do a bit of a dance here to ensure that whatever 'outer' description
1763-
# stack we might have, doesn't affect the validation code internal to the
1764-
# strategy we're drawing from. Otherwise, we'd get flaky fails like #3968.
1765-
def do_draw(self, data):
1766-
prev = description_stack[:]
1767-
try:
1768-
description_stack.clear()
1769-
return self.definition(data.draw, *self.args, **self.kwargs)
1770-
finally:
1771-
description_stack[:] = prev
1772-
1773-
else: # pragma: no cover
1774-
1775-
def do_draw(self, data):
1776-
return self.definition(data.draw, *self.args, **self.kwargs)
1760+
def do_draw(self, data):
1761+
return self.definition(data.draw, *self.args, **self.kwargs)
17771762

17781763
def calc_label(self):
17791764
return calc_label_from_cls(self.definition)

0 commit comments

Comments
 (0)