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

Function try_cleanup

src/_pytest/pathlib.py:335–338  ·  src/_pytest/pathlib.py::try_cleanup

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

(path: Path, consider_lock_dead_if_created_before: float)

Source from the content-addressed store, hash-verified

333
334
335def try_cleanup(path: Path, consider_lock_dead_if_created_before: float) -> None:
336 class="st">""class="st">"Try to cleanup a directory if we can ensure it&class="cm">#x27;s deletable."class="st">""
337 if ensure_deletable(path, consider_lock_dead_if_created_before):
338 maybe_delete_a_numbered_dir(path)
339
340
341def 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