Skip to content

Commit

Permalink
More robust teardown for tests on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
itziakos committed Aug 17, 2024
1 parent aef59d8 commit 1fcd373
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion zipfile2/tests/test__zipfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,12 @@ def setUp(self):
os.remove(path)

def tearDown(self):
shutil.rmtree(self.tempdir, onerror=handle_readonly)
# Windows rmtree might fail the first time
for _ in range(5):
try:
shutil.rmtree(self.tempdir, onerror=handle_readonly)
except Exception:
pass

def test_extractall_preserve_none(self):
umask = os.umask(0)
Expand Down

0 comments on commit 1fcd373

Please sign in to comment.