Skip to content

Commit

Permalink
Merge pull request #3855 from tybug/avoid-observability-warning
Browse files Browse the repository at this point in the history
Avoid side effect warning when `HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY` is set
  • Loading branch information
Zac-HD committed Jan 22, 2024
2 parents 022b1f2 + 12a225a commit 1f049ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RELEASE_TYPE: patch

This patch fixes a spurious warning about slow imports when ``HYPOTHESIS_EXPERIMENTAL_OBSERVABILITY`` was set.
2 changes: 1 addition & 1 deletion hypothesis-python/src/hypothesis/internal/observability.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ def _deliver_to_file(value): # pragma: no cover

# Remove files more than a week old, to cap the size on disk
max_age = (date.today() - timedelta(days=8)).isoformat()
for f in storage_directory("observed").glob("*.jsonl"):
for f in storage_directory("observed", intent_to_write=False).glob("*.jsonl"):
if f.stem < max_age: # pragma: no branch
f.unlink(missing_ok=True)

0 comments on commit 1f049ec

Please sign in to comment.