mirror of
https://github.com/python/cpython
synced 2024-10-09 05:19:50 +00:00
SF bug #785222: zlib monotonic test
For smaller datasets, it is not always true the increasing the compression level always results in better compression. Removed the test which made this invalid assumption.
This commit is contained in:
parent
9d12ab5c3c
commit
6d362b25c5
|
@ -96,17 +96,6 @@ def test_speech128(self):
|
|||
x = zlib.compress(data)
|
||||
self.assertEqual(zlib.decompress(x), data)
|
||||
|
||||
def test_monotonic(self):
|
||||
# higher compression levels should not expand compressed size
|
||||
data = hamlet_scene * 8 * 16
|
||||
last = length = len(zlib.compress(data, 0))
|
||||
self.failUnless(last > len(data), "compress level 0 always expands")
|
||||
for level in range(10):
|
||||
length = len(zlib.compress(data, level))
|
||||
self.failUnless(length <= last,
|
||||
'compress level %d more effective than %d!' % (
|
||||
level-1, level))
|
||||
last = length
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue