diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 11:37:54 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-10 11:37:54 (GMT) |
commit | 4847e4e1f47bae9ed1855801c70ce7fbdecfa32a (patch) | |
tree | d661b813961c03186fbff33dc46e0840de1abf99 /Lib/test/test_hashlib.py | |
parent | f451112413b9ea8940c8c3a902cddf701c62d17f (diff) | |
download | cpython-4847e4e1f47bae9ed1855801c70ce7fbdecfa32a.zip cpython-4847e4e1f47bae9ed1855801c70ce7fbdecfa32a.tar.gz cpython-4847e4e1f47bae9ed1855801c70ce7fbdecfa32a.tar.bz2 |
Issue #19886: Use better estimated memory requirements for bigmem tests.
Incorrect requirements can cause memory swapping.
Diffstat (limited to 'Lib/test/test_hashlib.py')
-rw-r--r-- | Lib/test/test_hashlib.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index f3385f6..c0470d6 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -235,21 +235,15 @@ class HashLibTestCase(unittest.TestCase): b'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'd174ab98d277d9f5a5611c2c9f419d9f') - @bigmemtest(size=_4G + 5, memuse=1) + @unittest.skipIf(sys.maxsize < _4G + 5, 'test cannot run on 32-bit systems') + @bigmemtest(size=_4G + 5, memuse=1, dry_run=False) def test_case_md5_huge(self, size): - if size == _4G + 5: - try: - self.check('md5', b'A'*size, 'c9af2dff37468ce5dfee8f2cfc0a9c6d') - except OverflowError: - pass # 32-bit arch + self.check('md5', b'A'*size, 'c9af2dff37468ce5dfee8f2cfc0a9c6d') - @bigmemtest(size=_4G - 1, memuse=1) + @unittest.skipIf(sys.maxsize < _4G - 1, 'test cannot run on 32-bit systems') + @bigmemtest(size=_4G - 1, memuse=1, dry_run=False) def test_case_md5_uintmax(self, size): - if size == _4G - 1: - try: - self.check('md5', b'A'*size, '28138d306ff1b8281f1a9067e1a1a2b3') - except OverflowError: - pass # 32-bit arch + self.check('md5', b'A'*size, '28138d306ff1b8281f1a9067e1a1a2b3') # use the three examples from Federal Information Processing Standards # Publication 180-1, Secure Hash Standard, 1995 April 17 |