summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:06:02 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:06:02 (GMT)
commit65ee4674e290ba893509f51f192dd1c9aa3a0422 (patch)
treec1e960162df4444ff18a2ad3aff11d713ef9ea12 /Lib/test/test_memoryio.py
parent0e32ea1089059a15b04a40c43bfe671e38ae16e7 (diff)
parentbad1257c96943dcb39584a41e1a178542479df97 (diff)
downloadcpython-65ee4674e290ba893509f51f192dd1c9aa3a0422.zip
cpython-65ee4674e290ba893509f51f192dd1c9aa3a0422.tar.gz
cpython-65ee4674e290ba893509f51f192dd1c9aa3a0422.tar.bz2
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/test_memoryio.py')
-rw-r--r--Lib/test/test_memoryio.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 23be5e9..ab67cf3 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -367,13 +367,14 @@ class MemoryTestMixin:
# the module-level.
import __main__
PickleTestMemIO.__module__ = '__main__'
+ PickleTestMemIO.__qualname__ = PickleTestMemIO.__name__
__main__.PickleTestMemIO = PickleTestMemIO
submemio = PickleTestMemIO(buf, 80)
submemio.seek(2)
# We only support pickle protocol 2 and onward since we use extended
# __reduce__ API of PEP 307 to provide pickling support.
- for proto in range(2, pickle.HIGHEST_PROTOCOL):
+ for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
for obj in (memio, submemio):
obj2 = pickle.loads(pickle.dumps(obj, protocol=proto))
self.assertEqual(obj.getvalue(), obj2.getvalue())