gh-102209: Sync with zipp 3.15 moving complexity tests into dedicated module (#102232)

Sync with jaraco/zipp@757a4e1a.
This commit is contained in:
Jason R. Coombs 2023-02-25 11:15:48 -05:00 committed by GitHub
parent 207e1c5cae
commit a35fd38b57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 87 additions and 51 deletions

View file

@ -0,0 +1,24 @@
import unittest
import string
import zipfile
from ._functools import compose
from ._itertools import consume
from ._support import import_or_skip
big_o = import_or_skip('big_o')
class TestComplexity(unittest.TestCase):
def test_implied_dirs_performance(self):
best, others = big_o.big_o(
compose(consume, zipfile.CompleteDirs._implied_dirs),
lambda size: [
'/'.join(string.ascii_lowercase + str(n)) for n in range(size)
],
max_n=1000,
min_n=1,
)
assert best <= big_o.complexities.Linear