diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 08:22:36 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 08:22:36 (GMT) |
commit | 94190bb6e7f3b1c7942b562fe0fad3e62b5386b9 (patch) | |
tree | 3ac53b23c66b169c63815a36db6688e94e78c1e6 /Lib/test/test_zlib.py | |
parent | ffd41d9f101e31973b8713e884c95118fceb6f59 (diff) | |
download | cpython-94190bb6e7f3b1c7942b562fe0fad3e62b5386b9.zip cpython-94190bb6e7f3b1c7942b562fe0fad3e62b5386b9.tar.gz cpython-94190bb6e7f3b1c7942b562fe0fad3e62b5386b9.tar.bz2 |
Start fixing test_bigmem:
- bigmemtest is replaced by precisionbigmemtest
- add a poor man's watchdog thread to print memory consumption
Diffstat (limited to 'Lib/test/test_zlib.py')
-rw-r--r-- | Lib/test/test_zlib.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index 68dd3ea..dffa2ca 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -3,7 +3,7 @@ from test import support import binascii import random import sys -from test.support import precisionbigmemtest, _1G, _4G +from test.support import bigmemtest, _1G, _4G zlib = support.import_module('zlib') @@ -177,16 +177,16 @@ class CompressTestCase(BaseCompressTestCase, unittest.TestCase): # Memory use of the following functions takes into account overallocation - @precisionbigmemtest(size=_1G + 1024 * 1024, memuse=3) + @bigmemtest(size=_1G + 1024 * 1024, memuse=3) def test_big_compress_buffer(self, size): compress = lambda s: zlib.compress(s, 1) self.check_big_compress_buffer(size, compress) - @precisionbigmemtest(size=_1G + 1024 * 1024, memuse=2) + @bigmemtest(size=_1G + 1024 * 1024, memuse=2) def test_big_decompress_buffer(self, size): self.check_big_decompress_buffer(size, zlib.decompress) - @precisionbigmemtest(size=_4G + 100, memuse=1) + @bigmemtest(size=_4G + 100, memuse=1) def test_length_overflow(self, size): if size < _4G + 100: self.skipTest("not enough free memory, need at least 4 GB") @@ -511,19 +511,19 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase): # Memory use of the following functions takes into account overallocation - @precisionbigmemtest(size=_1G + 1024 * 1024, memuse=3) + @bigmemtest(size=_1G + 1024 * 1024, memuse=3) def test_big_compress_buffer(self, size): c = zlib.compressobj(1) compress = lambda s: c.compress(s) + c.flush() self.check_big_compress_buffer(size, compress) - @precisionbigmemtest(size=_1G + 1024 * 1024, memuse=2) + @bigmemtest(size=_1G + 1024 * 1024, memuse=2) def test_big_decompress_buffer(self, size): d = zlib.decompressobj() decompress = lambda s: d.decompress(s) + d.flush() self.check_big_decompress_buffer(size, decompress) - @precisionbigmemtest(size=_4G + 100, memuse=1) + @bigmemtest(size=_4G + 100, memuse=1) def test_length_overflow(self, size): if size < _4G + 100: self.skipTest("not enough free memory, need at least 4 GB") |