Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hotpxl committed May 9, 2024
1 parent 3c8dc83 commit 8f2e935
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testing/test_assertrewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,11 @@ def fake_mkdir(p, exist_ok=False, *, exc):
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
Expand Down

0 comments on commit 8f2e935

Please sign in to comment.