Skip to content

Commit 52e09ea

Browse files
committed
fix monkeypatch
1 parent 62b329e commit 52e09ea

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

hypothesis-python/tests/conjecture/test_local_constants.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import pytest
1616

1717
from hypothesis import given, settings, strategies as st
18+
from hypothesis.configuration import StorageDirectory
1819
from hypothesis.internal.conjecture import providers
1920
from hypothesis.internal.conjecture.choice import choice_equal
2021
from hypothesis.internal.conjecture.providers import CONSTANTS_CACHE
@@ -85,7 +86,9 @@ def test_actual_collection(monkeypatch, tmp_path):
8586
# Reset to a guaranteed-empty storage directory to ensure consistent coverage.
8687
monkeypatch.setattr(
8788
"hypothesis.internal.constants_ast.storage_directory",
88-
lambda *names, **kwargs: tmp_path.joinpath(*names),
89+
lambda *names, **kwargs: StorageDirectory(
90+
tmp_path.joinpath(*names), home_directory=tmp_path
91+
),
8992
)
9093

9194
@given(st.integers())

0 commit comments

Comments
 (0)