Skip to content

Commit 77b2acf

Browse files
nateprewittalistairwatts
authored andcommitted
Cleanup extracted file after extract_zipped_path test (psf#7305)
1 parent 714d92c commit 77b2acf

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

tests/test_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,12 @@ def test_zipped_paths_extracted(self, tmpdir):
351351
zipped_path = os.path.join(zipped_py.strpath, name.lstrip(r"\/"))
352352
extracted_path = extract_zipped_paths(zipped_path)
353353

354-
assert extracted_path != zipped_path
355-
assert os.path.exists(extracted_path)
356-
assert filecmp.cmp(extracted_path, __file__)
354+
try:
355+
assert extracted_path != zipped_path
356+
assert os.path.exists(extracted_path)
357+
assert filecmp.cmp(extracted_path, __file__)
358+
finally:
359+
os.remove(extracted_path)
357360

358361
def test_invalid_unc_path(self):
359362
path = r"\\localhost\invalid\location"

0 commit comments

Comments
 (0)