Skip to content

Commit c6e6155

Browse files
authored
Update Lib/test/test_tarfile.py
1 parent ede7ba3 commit c6e6155

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Lib/test/test_tarfile.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,13 +1888,13 @@ def test_create_with_mtime(self):
18881888
def test_create_with_mtime_out_of_range(self):
18891889
# gh-133998: an mtime outside the gzip header's 32-bit range is
18901890
# stored as 0 rather than raising struct.error.
1891+
self.addCleanup(os_helper.unlink, tmpname)
18911892
for mtime in (-1, 2**32):
18921893
with self.subTest(mtime=mtime):
18931894
tarfile.open(tmpname, self.mode, mtime=mtime).close()
18941895
with self.open(tmpname, 'r') as fobj:
18951896
fobj.read()
18961897
self.assertEqual(fobj.mtime, 0)
1897-
os_helper.unlink(tmpname)
18981898

18991899
def test_create_with_mtime_at_boundary(self):
19001900
# gh-133998: the largest in-range mtime is preserved, not clamped.

0 commit comments

Comments
 (0)