mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-43613: Faster implementation of gzip.compress and gzip.decompress (GH-27941)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
parent
a7ef15aae8
commit
ea23e7820f
8 changed files with 195 additions and 89 deletions
|
@ -831,6 +831,13 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
|
|||
dco = zlib.decompressobj(32 + 15)
|
||||
self.assertEqual(dco.decompress(gzip), HAMLET_SCENE)
|
||||
|
||||
for wbits in (-15, 15, 31):
|
||||
with self.subTest(wbits=wbits):
|
||||
expected = HAMLET_SCENE
|
||||
actual = zlib.decompress(
|
||||
zlib.compress(HAMLET_SCENE, wbits=wbits), wbits=wbits
|
||||
)
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
def choose_lines(source, number, seed=None, generator=random):
|
||||
"""Return a list of number lines randomly chosen from the source"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue