This commit is contained in:
Yutian Li 2024-05-09 13:28:24 -04:00
parent 3c8dc83d21
commit 8f2e935574
1 changed files with 5 additions and 0 deletions

View File

@ -1972,6 +1972,11 @@ def test_try_makedirs(monkeypatch, tmp_path: Path) -> None:
monkeypatch.setattr(os, "makedirs", partial(fake_mkdir, exc=err))
assert not try_makedirs(p)
err = OSError()
err.errno = errno.ENOSYS
monkeypatch.setattr(os, "makedirs", partial(fake_mkdir, exc=err))
assert not try_makedirs(p)
# unhandled OSError should raise
err = OSError()
err.errno = errno.ECHILD