Skip to content

Commit 93f4c25

Browse files
committed
Fix bad test code
1 parent e76f9a1 commit 93f4c25

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Lib/test/test_zipfile/test_core.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,9 +1590,9 @@ def test_remove_zip64(self):
15901590
with self.assertRaises(KeyError):
15911591
zh.getinfo(self.test_files[i][0])
15921592

1593-
# make sure the zip file is still valid
1594-
with zipfile.ZipFile(TESTFN) as zh:
1595-
self.assertIsNone(zh.testzip())
1593+
# make sure the zip file is still valid
1594+
with zipfile.ZipFile(TESTFN) as zh:
1595+
self.assertIsNone(zh.testzip())
15961596

15971597
def test_remove_closed(self):
15981598
self._prepare_zip_from_test_files(TESTFN, self.test_files)
@@ -1861,9 +1861,9 @@ def test_repack_bytes_between_files(self):
18611861
# check file size
18621862
self.assertEqual(os.path.getsize(TESTFN), expected_size)
18631863

1864-
# make sure the zip file is still valid
1865-
with zipfile.ZipFile(TESTFN) as zh:
1866-
self.assertIsNone(zh.testzip())
1864+
# make sure the zip file is still valid
1865+
with zipfile.ZipFile(TESTFN) as zh:
1866+
self.assertIsNone(zh.testzip())
18671867

18681868
def test_repack_zip64(self):
18691869
"""Should correctly handle file entries with zip64."""
@@ -2158,9 +2158,9 @@ def test_repack_removed_partial(self):
21582158

21592159
def test_repack_removed_bytes_between_files(self):
21602160
"""Should not remove bytes between local file entries."""
2161-
# calculate the expected results
21622161
for ii in ([0], [1], [2]):
21632162
with self.subTest(removed=ii):
2163+
# calculate the expected results
21642164
expected_zinfos = []
21652165
with open(TESTFN, 'wb') as fh:
21662166
with zipfile.ZipFile(fh, 'w', self.compression) as zh:
@@ -2198,7 +2198,6 @@ def test_repack_removed_bytes_between_files(self):
21982198

21992199
def test_repack_removed_bad_removed_zinfos(self):
22002200
"""Should raise when providing non-removed zinfos."""
2201-
# calculate the expected results
22022201
for ii in ([0], [1], [2]):
22032202
with self.subTest(removed=ii):
22042203
self._prepare_zip_from_test_files(TESTFN, self.test_files)

0 commit comments

Comments
 (0)