diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 08:28:37 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-10-04 08:28:37 (GMT) |
commit | 1a3ff48c55fcb4dd8151750976242d83a84a09b0 (patch) | |
tree | 74f4f275edb2206b64eb2aeaf0be9406814c1b71 /Lib/test/test_zlib.py | |
parent | 5a688dbf97f1537d3f2309bfe6be93dab2f10ce0 (diff) | |
parent | 94190bb6e7f3b1c7942b562fe0fad3e62b5386b9 (diff) | |
download | cpython-1a3ff48c55fcb4dd8151750976242d83a84a09b0.zip cpython-1a3ff48c55fcb4dd8151750976242d83a84a09b0.tar.gz cpython-1a3ff48c55fcb4dd8151750976242d83a84a09b0.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 8d137ac..51a9d4b 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') @@ -188,16 +188,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") @@ -542,19 +542,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") |