diff options
author | Kristj?n Valur J?nsson <kristjan@ccpgames.com> | 2012-04-03 10:49:41 +0000 |
---|---|---|
committer | Kristj?n Valur J?nsson <kristjan@ccpgames.com> | 2012-04-03 10:49:41 +0000 |
commit | 85f68bdee6df6f2426de597a97f9c33c7066570f (patch) | |
tree | 0b05165701d0e3674afd24d170f1eeea4c9b3a24 /Lib/test/seq_tests.py | |
parent | 63da8b8acc00d6bcdd5251f6ffd1a90bdf1efa53 (diff) | |
download | cpython-85f68bdee6df6f2426de597a97f9c33c7066570f.tar.gz |
Issue #14288: Serialization support for builtin iterators.
Diffstat (limited to 'Lib/test/seq_tests.py')
-rw-r--r-- | Lib/test/seq_tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py index f655c29eee..f185a8251c 100644 --- a/Lib/test/seq_tests.py +++ b/Lib/test/seq_tests.py @@ -4,6 +4,7 @@ Tests common to tuple, list and UserList.UserList import unittest import sys +import pickle # Various iterables # This is used for checking the constructor (here and in test_deque.py) @@ -388,3 +389,9 @@ class CommonTest(unittest.TestCase): self.assertEqual(a.index(0, -4*sys.maxsize, 4*sys.maxsize), 2) self.assertRaises(ValueError, a.index, 0, 4*sys.maxsize,-4*sys.maxsize) self.assertRaises(ValueError, a.index, 2, 0, -10) + + 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)) |