mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Try to fix one of the bigmem tests in test_pickle
This commit is contained in:
commit
2d243494c6
1 changed files with 5 additions and 0 deletions
|
@ -1228,11 +1228,16 @@ class BigmemPickleTests(unittest.TestCase):
|
||||||
finally:
|
finally:
|
||||||
data = None
|
data = None
|
||||||
|
|
||||||
|
# BINUNICODE (protocols 1, 2 and 3) cannot carry more than
|
||||||
|
# 2**32 - 1 bytes of utf-8 encoded unicode.
|
||||||
|
|
||||||
@precisionbigmemtest(size=_4G, memuse=1 + character_size, dry_run=False)
|
@precisionbigmemtest(size=_4G, memuse=1 + character_size, dry_run=False)
|
||||||
def test_huge_str_64b(self, size):
|
def test_huge_str_64b(self, size):
|
||||||
data = "a" * size
|
data = "a" * size
|
||||||
try:
|
try:
|
||||||
for proto in protocols:
|
for proto in protocols:
|
||||||
|
if proto == 0:
|
||||||
|
continue
|
||||||
with self.assertRaises((ValueError, OverflowError)):
|
with self.assertRaises((ValueError, OverflowError)):
|
||||||
self.dumps(data, protocol=proto)
|
self.dumps(data, protocol=proto)
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue