on_rm_rf_error: ignore os.open (no warning)

Ref: https://github.com/pytest-dev/pytest/pull/6044/files#r339321752
This commit is contained in:
Daniel Hahler
2019-10-27 02:28:35 +01:00
parent 5be3a9b5ce
commit 8aa0809fbc
2 changed files with 13 additions and 5 deletions

View File

@@ -68,13 +68,14 @@ def on_rm_rf_error(func, path: str, exc, *, start_path: Path) -> bool:
return False
if func not in (os.rmdir, os.remove, os.unlink):
warnings.warn(
PytestWarning(
"(rm_rf) unknown function {} when removing {}:\n{}: {}".format(
path, func, exctype, excvalue
if func not in (os.open,):
warnings.warn(
PytestWarning(
"(rm_rf) unknown function {} when removing {}:\n{}: {}".format(
path, func, exctype, excvalue
)
)
)
)
return False
# Chmod + retry.