gh-106531: Refresh zipfile._path with zipp 3.18. (#116835)

* gh-106531: Refresh zipfile._path with zipp 3.18.

* Add blurb
This commit is contained in:
Jason R. Coombs 2024-03-14 17:53:50 -04:00 committed by GitHub
parent ab9e322ae1
commit be59aaf3ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 159 additions and 54 deletions

View file

@ -43,13 +43,17 @@ class TestComplexity(unittest.TestCase):
@classmethod
def make_names(cls, width, letters=string.ascii_lowercase):
"""
>>> list(TestComplexity.make_names(1))
['a']
>>> list(TestComplexity.make_names(2))
['a', 'b']
>>> list(TestComplexity.make_names(30))
['aa', 'ab', ..., 'bd']
>>> list(TestComplexity.make_names(17124))
['aaa', 'aab', ..., 'zip']
"""
# determine how many products are needed to produce width
n_products = math.ceil(math.log(width, len(letters)))
n_products = max(1, math.ceil(math.log(width, len(letters))))
inputs = (letters,) * n_products
combinations = itertools.product(*inputs)
names = map(''.join, combinations)
@ -80,7 +84,7 @@ class TestComplexity(unittest.TestCase):
max_n=100,
min_n=1,
)
assert best <= big_o.complexities.Quadratic
assert best <= big_o.complexities.Linear
@pytest.mark.flaky
def test_glob_width(self):