File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ Pedro Algarvio
227227Philipp Loose
228228Pieter Mulder
229229Piotr Banaszkiewicz
230+ Piotr Helm
230231Prashant Anand
231232Pulkit Goyal
232233Punyashloka Biswal
Original file line number Diff line number Diff line change 1+ Fix issue where directories from tmpdir are not removed properly when multiple instances of pytest are running in parallel.
Original file line number Diff line number Diff line change @@ -333,16 +333,18 @@ def make_numbered_dir_with_cleanup(
333333 try :
334334 p = make_numbered_dir (root , prefix )
335335 lock_path = create_cleanup_lock (p )
336- register_cleanup_lock_removal (lock_path )
336+ register_cleanup_lock_removal (lock_path )
337337 except Exception as exc :
338338 e = exc
339339 else :
340340 consider_lock_dead_if_created_before = p .stat ().st_mtime - lock_timeout
341- cleanup_numbered_dir (
342- root = root ,
343- prefix = prefix ,
344- keep = keep ,
345- consider_lock_dead_if_created_before = consider_lock_dead_if_created_before ,
341+ # Register a cleanup for program exit
342+ atexit .register (
343+ cleanup_numbered_dir ,
344+ root ,
345+ prefix ,
346+ keep ,
347+ consider_lock_dead_if_created_before ,
346348 )
347349 return p
348350 assert e is not None
You can’t perform that action at this time.
0 commit comments