mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Update test_zipfile64.py from 3.13.11 (#6433)
* Update `test_zipfile64.py` from 3.13.11 * Mark flaky test
This commit is contained in:
1 parent
9aa1f18998
commit
adc2b0dbbe
2 files changed
+6
-8
No files matched your search
Vendored
+1
@@ -457,6 +457,7 @@ class ImportTests(unittest.TestCase):
|
||||
with self.assertRaises(AttributeError):
|
||||
os.does_not_exist
|
||||
|
||||
@unittest.skipIf(sys.platform == 'win32', 'TODO: RUSTPYTHON; Flaky')
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_concurrency(self):
|
||||
# bpo 38091: this is a hack to slow down the code that calls
|
||||
|
||||
Vendored
+5
-8
@@ -11,7 +11,7 @@ support.requires(
|
||||
'test requires loads of disk-space bytes and a long time to run'
|
||||
)
|
||||
|
||||
import zipfile, os, unittest
|
||||
import zipfile, unittest
|
||||
import time
|
||||
import sys
|
||||
|
||||
@@ -32,10 +32,6 @@ class TestsWithSourceFile(unittest.TestCase):
|
||||
line_gen = ("Test of zipfile line %d." % i for i in range(1000000))
|
||||
self.data = '\n'.join(line_gen).encode('ascii')
|
||||
|
||||
# And write it to a file.
|
||||
with open(TESTFN, "wb") as fp:
|
||||
fp.write(self.data)
|
||||
|
||||
def zipTest(self, f, compression):
|
||||
# Create the ZIP archive.
|
||||
with zipfile.ZipFile(f, "w", compression) as zipfp:
|
||||
@@ -67,6 +63,9 @@ class TestsWithSourceFile(unittest.TestCase):
|
||||
(num, filecount)), file=sys.__stdout__)
|
||||
sys.__stdout__.flush()
|
||||
|
||||
# Check that testzip thinks the archive is valid
|
||||
self.assertIsNone(zipfp.testzip())
|
||||
|
||||
def testStored(self):
|
||||
# Try the temp file first. If we do TESTFN2 first, then it hogs
|
||||
# gigabytes of disk space for the duration of the test.
|
||||
@@ -85,9 +84,7 @@ class TestsWithSourceFile(unittest.TestCase):
|
||||
self.zipTest(TESTFN2, zipfile.ZIP_DEFLATED)
|
||||
|
||||
def tearDown(self):
|
||||
for fname in TESTFN, TESTFN2:
|
||||
if os.path.exists(fname):
|
||||
os.remove(fname)
|
||||
os_helper.unlink(TESTFN2)
|
||||
|
||||
|
||||
class OtherTests(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user