summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-02-29 16:34:11 (GMT)
committerGitHub <noreply@github.com>2020-02-29 16:34:11 (GMT)
commit0aeab5c4381f0cc11479362af2533b3a391312ac (patch)
tree11f53305312285e0bd7a911dc883294d9f73bef0 /Lib/test
parent1f0cd3c61a5ae3aac5ebaccc75ae9828ca4f96c4 (diff)
downloadcpython-0aeab5c4381f0cc11479362af2533b3a391312ac.zip
cpython-0aeab5c4381f0cc11479362af2533b3a391312ac.tar.gz
cpython-0aeab5c4381f0cc11479362af2533b3a391312ac.tar.bz2
bpo-39667: Sync zipp 3.0 (GH-18540)
* bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct performance degradation as found in zipp 3.0 * 📜🤖 Added by blurb_it. * Update docs for new zipfile.Path.open * Rely on dict, faster than OrderedDict. * Syntax edits on docs Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_zipfile.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 09fc850..643c5b4 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -5,6 +5,7 @@ import itertools
import os
import pathlib
import posixpath
+import string
import struct
import subprocess
import sys
@@ -2880,7 +2881,7 @@ class TestPath(unittest.TestCase):
a, b, g = root.iterdir()
with a.open() as strm:
data = strm.read()
- assert data == b"content of a"
+ assert data == "content of a"
def test_read(self):
for alpharep in self.zipfile_alpharep():
@@ -2974,6 +2975,11 @@ class TestPath(unittest.TestCase):
# Check the file iterated all items
assert entries.count == self.HUGE_ZIPFILE_NUM_ENTRIES
+ # @func_timeout.func_set_timeout(3)
+ def test_implied_dirs_performance(self):
+ data = ['/'.join(string.ascii_lowercase + str(n)) for n in range(10000)]
+ zipfile.CompleteDirs._implied_dirs(data)
+
if __name__ == "__main__":
unittest.main()