diff options
author | Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com> | 2024-05-29 12:13:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-29 12:13:18 (GMT) |
commit | 055c739536ad63b55ad7cd0b91ccacc33064fe11 (patch) | |
tree | 4f5320b354387cc7033816f5133ae9c547f9e767 /Lib/test/support | |
parent | 0cdc5c8d5446e5eedd34e03d8e380bc237d1379b (diff) | |
download | cpython-055c739536ad63b55ad7cd0b91ccacc33064fe11.zip cpython-055c739536ad63b55ad7cd0b91ccacc33064fe11.tar.gz cpython-055c739536ad63b55ad7cd0b91ccacc33064fe11.tar.bz2 |
CI: set correct working directory for Hypothesis cache (GH-119345)
Set cwd for Hypothesis database
Diffstat (limited to 'Lib/test/support')
-rw-r--r-- | Lib/test/support/hypothesis_helper.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/support/hypothesis_helper.py b/Lib/test/support/hypothesis_helper.py index db93eea..40f58a2 100644 --- a/Lib/test/support/hypothesis_helper.py +++ b/Lib/test/support/hypothesis_helper.py @@ -5,6 +5,13 @@ try: except ImportError: from . import _hypothesis_stubs as hypothesis else: + # Regrtest changes to use a tempdir as the working directory, so we have + # to tell Hypothesis to use the original in order to persist the database. + from .os_helper import SAVEDCWD + from hypothesis.configuration import set_hypothesis_home_dir + + set_hypothesis_home_dir(os.path.join(SAVEDCWD, ".hypothesis")) + # When using the real Hypothesis, we'll configure it to ignore occasional # slow tests (avoiding flakiness from random VM slowness in CI). hypothesis.settings.register_profile( |