summaryrefslogtreecommitdiffstats
path: root/Lib/test/seq_tests.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:03:42 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:03:42 (GMT)
commitbad1257c96943dcb39584a41e1a178542479df97 (patch)
treedbb4594291c7df3660da701eb062bec35446bcba /Lib/test/seq_tests.py
parent79b81738ef052e9406adb8e98f0d292928053c01 (diff)
downloadcpython-bad1257c96943dcb39584a41e1a178542479df97.zip
cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.gz
cpython-bad1257c96943dcb39584a41e1a178542479df97.tar.bz2
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/seq_tests.py')
-rw-r--r--Lib/test/seq_tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py
index f185a82..9834af1 100644
--- a/Lib/test/seq_tests.py
+++ b/Lib/test/seq_tests.py
@@ -392,6 +392,7 @@ class CommonTest(unittest.TestCase):
def test_pickle(self):
lst = self.type2test([4, 5, 6, 7])
- lst2 = pickle.loads(pickle.dumps(lst))
- self.assertEqual(lst2, lst)
- self.assertNotEqual(id(lst2), id(lst))
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ lst2 = pickle.loads(pickle.dumps(lst, proto))
+ self.assertEqual(lst2, lst)
+ self.assertNotEqual(id(lst2), id(lst))