Skip to content

Commit 0e54ea3

Browse files
committed
gh-152190: Remove unneeded comments and checks
The similar comments present in `TestsWithSourceFile` because the test contains one for `TemporaryFile()` and another for `TESTFN2`, which is not the case for `TestRepack` since only `TemporaryFile()` is used. Asserting file handler not closed is already included in `TestsWithSourceFile` and is unnecessary for `TestRepack`.
1 parent a5db266 commit 0e54ea3

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

Lib/test/test_zipfile64.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ def _write_large_file(self, fh):
133133
def test_strip_removed_large_file(self):
134134
"""Should move the physical data of a file positioned after a large
135135
removed file without causing a memory issue."""
136-
# Try the temp file. If we do TESTFN2, then it hogs
137-
# gigabytes of disk space for the duration of the test.
138136
with TemporaryFile() as f:
139137
file = 'file.txt'
140138
file1 = 'largefile.txt'
@@ -150,13 +148,9 @@ def test_strip_removed_large_file(self):
150148
zh.repack()
151149
self.assertIsNone(zh.testzip())
152150

153-
self.assertFalse(f.closed)
154-
155151
def test_strip_removed_file_before_large_file(self):
156152
"""Should move the physical data of a large file positioned after a
157153
removed file without causing a memory issue."""
158-
# Try the temp file. If we do TESTFN2, then it hogs
159-
# gigabytes of disk space for the duration of the test.
160154
with TemporaryFile() as f:
161155
file = 'file.txt'
162156
file1 = 'largefile.txt'
@@ -172,13 +166,9 @@ def test_strip_removed_file_before_large_file(self):
172166
zh.repack()
173167
self.assertIsNone(zh.testzip())
174168

175-
self.assertFalse(f.closed)
176-
177169
def test_strip_removed_large_file_with_dd(self):
178170
"""Should scan for the data descriptor of a removed large file without
179171
causing a memory issue."""
180-
# Try the temp file. If we do TESTFN2, then it hogs
181-
# gigabytes of disk space for the duration of the test.
182172
with TemporaryFile() as f:
183173
file = 'file.txt'
184174
file1 = 'largefile.txt'
@@ -194,16 +184,12 @@ def test_strip_removed_large_file_with_dd(self):
194184
zh.repack()
195185
self.assertIsNone(zh.testzip())
196186

197-
self.assertFalse(f.closed)
198-
199187
def test_strip_removed_large_file_with_dd_no_sig(self):
200188
"""Should scan for the unsigned data descriptor of a removed large file
201189
without causing a memory issue."""
202190
# Reduce data scale for this test, as it's especially slow...
203191
self.datacount = 30*1024**2 // len(self.data)
204192

205-
# Try the temp file. If we do TESTFN2, then it hogs
206-
# gigabytes of disk space for the duration of the test.
207193
with TemporaryFile() as f:
208194
file = 'file.txt'
209195
file1 = 'largefile.txt'
@@ -222,14 +208,10 @@ def test_strip_removed_large_file_with_dd_no_sig(self):
222208
zh.repack(strict_descriptor=False)
223209
self.assertIsNone(zh.testzip())
224210

225-
self.assertFalse(f.closed)
226-
227211
@requires_zlib()
228212
def test_strip_removed_large_file_with_dd_no_sig_by_decompression(self):
229213
"""Should scan for the unsigned data descriptor (via tracing compressed
230214
block end) of a removed large file without causing a memory issue."""
231-
# Try the temp file. If we do TESTFN2, then it hogs
232-
# gigabytes of disk space for the duration of the test.
233215
with TemporaryFile() as f:
234216
file = 'file.txt'
235217
file1 = 'largefile.txt'

0 commit comments

Comments
 (0)