MCPcopy Create free account
hub / github.com/pytest-dev/pytest / cleanup_numbered_dir

Function cleanup_numbered_dir

src/_pytest/pathlib.py:338–345  ·  view source on GitHub ↗

Cleanup for lock driven numbered directories.

(
    root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float
)

Source from the content-addressed store, hash-verified

336
337
338def cleanup_numbered_dir(
339 root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float
340) -> None:
341 """Cleanup for lock driven numbered directories."""
342 for path in cleanup_candidates(root, prefix, keep):
343 try_cleanup(path, consider_lock_dead_if_created_before)
344 for path in root.glob("garbage-*"):
345 try_cleanup(path, consider_lock_dead_if_created_before)
346
347
348def make_numbered_dir_with_cleanup(

Callers 1

_do_cleanupMethod · 0.90

Calls 2

cleanup_candidatesFunction · 0.85
try_cleanupFunction · 0.85

Tested by 1

_do_cleanupMethod · 0.72