Update tmpdir.py
This commit is contained in:
parent
341ec662ff
commit
81be46308b
|
@ -305,13 +305,13 @@ def pytest_sessionfinish(session, exitstatus: Union[int, ExitCode]):
|
|||
and policy == "failed"
|
||||
and tmp_path_factory._given_basetemp is None
|
||||
):
|
||||
if basetemp.exists():
|
||||
if basetemp.is_dir():
|
||||
# We do a "best effort" to remove files, but it might not be possible due to some leaked resource,
|
||||
# permissions, etc, in which case we ignore it.
|
||||
rmtree(basetemp, ignore_errors=True)
|
||||
return
|
||||
|
||||
# Remove dead symlinks.
|
||||
if basetemp.is_dir():
|
||||
cleanup_dead_symlinks(basetemp)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue