MCPcopy
hub / github.com/pytest-dev/pytest / cleanup_numbered_dir

Function cleanup_numbered_dir

src/_pytest/pathlib.py:360–371  ·  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

358
359
360def cleanup_numbered_dir(
361 root: Path, prefix: str, keep: int, consider_lock_dead_if_created_before: float
362) -> None:
363 """Cleanup for lock driven numbered directories."""
364 if not root.exists():
365 return
366 for path in cleanup_candidates(root, prefix, keep):
367 try_cleanup(path, consider_lock_dead_if_created_before)
368 for path in root.glob("garbage-*"):
369 try_cleanup(path, consider_lock_dead_if_created_before)
370
371 cleanup_dead_symlinks(root)
372
373
374def make_numbered_dir_with_cleanup(

Callers 1

_do_cleanupMethod · 0.90

Calls 4

cleanup_candidatesFunction · 0.85
try_cleanupFunction · 0.85
cleanup_dead_symlinksFunction · 0.85
existsMethod · 0.45

Tested by 1

_do_cleanupMethod · 0.72