summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-09 18:33:21 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-09 18:33:21 (GMT)
commitea99c5c94985c21d8a64c9a3d753bde7f801c14a (patch)
tree193ab657d8c66abf7b3147b17b5d1fe7c79f3c87 /Lib/test/pickletester.py
parent350c7229be7b288e2f4c93d0ae2e111cb15f640e (diff)
downloadcpython-ea99c5c94985c21d8a64c9a3d753bde7f801c14a.zip
cpython-ea99c5c94985c21d8a64c9a3d753bde7f801c14a.tar.gz
cpython-ea99c5c94985c21d8a64c9a3d753bde7f801c14a.tar.bz2
Issue #9410: Various optimizations to the pickle module, leading to
speedups up to 4x (depending on the benchmark). Mostly ported from Unladen Swallow; initial patch by Alexandre Vassalotti.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 70e5ad0..33c85dc 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -1068,6 +1068,15 @@ class AbstractPickleTests(unittest.TestCase):
dumped = self.dumps(set([3]), 2)
self.assertEqual(dumped, DATA6)
+ def test_large_pickles(self):
+ # Test the correctness of internal buffering routines when handling
+ # large data.
+ for proto in protocols:
+ data = (1, b'x' * (256 * 1024))
+ dumped = self.dumps(data, proto)
+ loaded = self.loads(dumped)
+ self.assertEqual(loaded, data)
+
# Test classes for reduce_ex