From 55a8f476ac61d5866bd2d2979b7da50e473cbe96 Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Wed, 8 Jan 2025 13:22:08 -0500 Subject: [PATCH] fix not freezing in BackendCannotProceed --- hypothesis-python/RELEASE.rst | 3 +++ hypothesis-python/src/hypothesis/internal/conjecture/engine.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 hypothesis-python/RELEASE.rst diff --git a/hypothesis-python/RELEASE.rst b/hypothesis-python/RELEASE.rst new file mode 100644 index 0000000000..078010a670 --- /dev/null +++ b/hypothesis-python/RELEASE.rst @@ -0,0 +1,3 @@ +RELEASE_TYPE: patch + +Fixes a bug caused by :ref:`alternative backends ` raising ``hypothesis.errors.BackendCannotProceed`` in certain cases. diff --git a/hypothesis-python/src/hypothesis/internal/conjecture/engine.py b/hypothesis-python/src/hypothesis/internal/conjecture/engine.py index 1d6420652c..ace5c2f3a1 100644 --- a/hypothesis-python/src/hypothesis/internal/conjecture/engine.py +++ b/hypothesis-python/src/hypothesis/internal/conjecture/engine.py @@ -484,6 +484,7 @@ def test_function(self, data: ConjectureData) -> None: self._switch_to_hypothesis_provider = True # skip the post-test-case tracking; we're pretending this never happened interrupted = True + data.freeze() return except BaseException: self.save_buffer(data.buffer)