File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
hypothesis-python/src/hypothesis Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -823,7 +823,12 @@ def execute_once(
823
823
self ._string_repr = ""
824
824
text_repr = None
825
825
if self .settings .deadline is None and not TESTCASE_CALLBACKS :
826
- test = self .test
826
+
827
+ @proxies (self .test )
828
+ def test (* args , ** kwargs ):
829
+ with ensure_free_stackframes ():
830
+ return self .test (* args , ** kwargs )
831
+
827
832
else :
828
833
829
834
@proxies (self .test )
@@ -833,7 +838,8 @@ def test(*args, **kwargs):
833
838
arg_gctime = gc_cumulative_time ()
834
839
start = time .perf_counter ()
835
840
try :
836
- result = self .test (* args , ** kwargs )
841
+ with ensure_free_stackframes ():
842
+ result = self .test (* args , ** kwargs )
837
843
finally :
838
844
finish = time .perf_counter ()
839
845
in_drawtime = math .fsum (data .draw_times .values ()) - arg_drawtime
Original file line number Diff line number Diff line change @@ -299,7 +299,9 @@ def __stoppable_test_function(self, data: ConjectureData) -> None:
299
299
"""
300
300
# We ensure that the test has this much stack space remaining, no
301
301
# matter the size of the stack when called, to de-flake RecursionErrors
302
- # (#2494, #3671).
302
+ # (#2494, #3671). Note, this covers the data generation part of the test;
303
+ # the actual test execution is additionally protected at the call site
304
+ # in hypothesis.core.execute_once.
303
305
with ensure_free_stackframes ():
304
306
try :
305
307
self ._test_function (data )
You can’t perform that action at this time.
0 commit comments