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

Function try_cleanup

src/_pytest/pathlib.py:320–323  ·  view source on GitHub ↗

Try to cleanup a folder if we can ensure it's deletable.

(path: Path, consider_lock_dead_if_created_before: float)

Source from the content-addressed store, hash-verified

318
319
320def try_cleanup(path: Path, consider_lock_dead_if_created_before: float) -> None:
321 """Try to cleanup a folder if we can ensure it's deletable."""
322 if ensure_deletable(path, consider_lock_dead_if_created_before):
323 maybe_delete_a_numbered_dir(path)
324
325
326def cleanup_candidates(root: Path, prefix: str, keep: int) -> Iterator[Path]:

Callers 1

cleanup_numbered_dirFunction · 0.85

Calls 2

ensure_deletableFunction · 0.85

Tested by

no test coverage detected