From: Raymond Hettinger Date: Sun, 31 Aug 2003 04:37:25 +0000 (+0000) Subject: SF bug #785222: zlib monotonic test X-Git-Tag: v2.3.1~114 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=81114e4808f0cbb70a4cea539a5bb4f6b206d5b8;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index c703964e3f35..3ad255f8bff5 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -96,17 +96,6 @@ class CompressTestCase(unittest.TestCase): 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