Skip to content

Commit adc2b0d

Browse files
authored
Update test_zipfile64.py from 3.13.11 (RustPython#6433)
* Update `test_zipfile64.py` from 3.13.11 * Mark flaky test
1 parent 9aa1f18 commit adc2b0d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Lib/test/test_import/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ def test_issue31492(self):
457457
with self.assertRaises(AttributeError):
458458
os.does_not_exist
459459

460+
@unittest.skipIf(sys.platform == 'win32', 'TODO: RUSTPYTHON; Flaky')
460461
@threading_helper.requires_working_threading()
461462
def test_concurrency(self):
462463
# bpo 38091: this is a hack to slow down the code that calls

Lib/test/test_zipfile64.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
'test requires loads of disk-space bytes and a long time to run'
1212
)
1313

14-
import zipfile, os, unittest
14+
import zipfile, unittest
1515
import time
1616
import sys
1717

@@ -32,10 +32,6 @@ def setUp(self):
3232
line_gen = ("Test of zipfile line %d." % i for i in range(1000000))
3333
self.data = '\n'.join(line_gen).encode('ascii')
3434

35-
# And write it to a file.
36-
with open(TESTFN, "wb") as fp:
37-
fp.write(self.data)
38-
3935
def zipTest(self, f, compression):
4036
# Create the ZIP archive.
4137
with zipfile.ZipFile(f, "w", compression) as zipfp:
@@ -67,6 +63,9 @@ def zipTest(self, f, compression):
6763
(num, filecount)), file=sys.__stdout__)
6864
sys.__stdout__.flush()
6965

66+
# Check that testzip thinks the archive is valid
67+
self.assertIsNone(zipfp.testzip())
68+
7069
def testStored(self):
7170
# Try the temp file first. If we do TESTFN2 first, then it hogs
7271
# gigabytes of disk space for the duration of the test.
@@ -85,9 +84,7 @@ def testDeflated(self):
8584
self.zipTest(TESTFN2, zipfile.ZIP_DEFLATED)
8685

8786
def tearDown(self):
88-
for fname in TESTFN, TESTFN2:
89-
if os.path.exists(fname):
90-
os.remove(fname)
87+
os_helper.unlink(TESTFN2)
9188

9289

9390
class OtherTests(unittest.TestCase):

0 commit comments

Comments
 (0)