summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-04-15 18:45:25 (GMT)
committerGitHub <noreply@github.com>2020-04-15 18:45:25 (GMT)
commit3e72de9e08b03a15875f5b226c5f096e567dab42 (patch)
treea3d8aa505aa1f50866a062ee46edd65c7ba2073c /Lib/test
parent59047fab0ef37f583c9e7c3a48d67792fd10ff91 (diff)
downloadcpython-3e72de9e08b03a15875f5b226c5f096e567dab42.zip
cpython-3e72de9e08b03a15875f5b226c5f096e567dab42.tar.gz
cpython-3e72de9e08b03a15875f5b226c5f096e567dab42.tar.bz2
[3.8] bpo-39667: Sync zipp 3.0 (GH-18540) (GH-18701)
* 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> (cherry picked from commit 0aeab5c4381f0cc11479362af2533b3a391312ac) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> * Clarify the change in behavior with a couple of workaround options. * Restore API compatibility while backporting performance improvements. Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_zipfile.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 61bca86..28e62dc 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
@@ -2933,6 +2934,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()