diff options
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r-- | Lib/test/pickletester.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 1f59ab2..a2bea60 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -21,8 +21,6 @@ from pickle import bytes_types # kind of outer loop. protocols = range(pickle.HIGHEST_PROTOCOL + 1) -ascii_char_size = 1 - # Return True if opcode code appears in the pickle, else False. def opcode_in_pickle(code, pickle): @@ -1643,7 +1641,7 @@ class BigmemPickleTests(unittest.TestCase): # Binary protocols can serialize longs of up to 2GB-1 - @bigmemtest(size=_2G, memuse=1 + 1, dry_run=False) + @bigmemtest(size=_2G, memuse=3.6, dry_run=False) def test_huge_long_32b(self, size): data = 1 << (8 * size) try: @@ -1660,7 +1658,7 @@ class BigmemPickleTests(unittest.TestCase): # (older protocols don't have a dedicated opcode for bytes and are # too inefficient) - @bigmemtest(size=_2G, memuse=1 + 1, dry_run=False) + @bigmemtest(size=_2G, memuse=2.5, dry_run=False) def test_huge_bytes_32b(self, size): data = b"abcd" * (size // 4) try: @@ -1681,7 +1679,7 @@ class BigmemPickleTests(unittest.TestCase): finally: data = None - @bigmemtest(size=_4G, memuse=1 + 1, dry_run=False) + @bigmemtest(size=_4G, memuse=2.5, dry_run=False) def test_huge_bytes_64b(self, size): data = b"acbd" * (size // 4) try: @@ -1711,7 +1709,7 @@ class BigmemPickleTests(unittest.TestCase): # All protocols use 1-byte per printable ASCII character; we add another # byte because the encoded form has to be copied into the internal buffer. - @bigmemtest(size=_2G, memuse=2 + ascii_char_size, dry_run=False) + @bigmemtest(size=_2G, memuse=8, dry_run=False) def test_huge_str_32b(self, size): data = "abcd" * (size // 4) try: @@ -1738,7 +1736,7 @@ class BigmemPickleTests(unittest.TestCase): # of utf-8 encoded unicode. BINUNICODE8 (protocol 4) supports these huge # unicode strings however. - @bigmemtest(size=_4G, memuse=2 + ascii_char_size, dry_run=False) + @bigmemtest(size=_4G, memuse=8, dry_run=False) def test_huge_str_64b(self, size): data = "abcd" * (size // 4) try: |