diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py index 8c68fe9e5..29d8c4dc9 100644 --- a/src/_pytest/pathlib.py +++ b/src/_pytest/pathlib.py @@ -333,7 +333,7 @@ def make_numbered_dir_with_cleanup( try: p = make_numbered_dir(root, prefix) lock_path = create_cleanup_lock(p) - register_cleanup_lock_removal(lock_path) + register_cleanup_lock_removal(lock_path) except Exception as exc: e = exc else: