Skip to content

Commit 389eea5

Browse files
authored
Cleanup extracted file after extract_zipped_path test (#7305)
1 parent 7407309 commit 389eea5

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
@@ -361,9 +361,12 @@ def test_zipped_paths_extracted(self, tmpdir):
361361
zipped_path = os.path.join(zipped_py.strpath, name.lstrip(r"\/"))
362362
extracted_path = extract_zipped_paths(zipped_path)
363363

364-
assert extracted_path != zipped_path
365-
assert os.path.exists(extracted_path)
366-
assert filecmp.cmp(extracted_path, __file__)
364+
try:
365+
assert extracted_path != zipped_path
366+
assert os.path.exists(extracted_path)
367+
assert filecmp.cmp(extracted_path, __file__)
368+
finally:
369+
os.remove(extracted_path)
367370

368371
def test_invalid_unc_path(self):
369372
path = r"\\localhost\invalid\location"

0 commit comments

Comments
 (0)