summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_sets.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:02:43 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-15 12:02:43 (GMT)
commit655720e2758a15c85effb340ff65f4b93e7cc7a7 (patch)
treed582731bc3e14a86222093e806d2ec88b2640f8f /Lib/test/test_sets.py
parentc3741a067b3443cdac7739b21e0cd1bacf155b02 (diff)
downloadcpython-655720e2758a15c85effb340ff65f4b93e7cc7a7.zip
cpython-655720e2758a15c85effb340ff65f4b93e7cc7a7.tar.gz
cpython-655720e2758a15c85effb340ff65f4b93e7cc7a7.tar.bz2
Issue #22777: Test pickling with all protocols.
Diffstat (limited to 'Lib/test/test_sets.py')
-rw-r--r--Lib/test/test_sets.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_sets.py b/Lib/test/test_sets.py
index 319bdcb..0a89908 100644
--- a/Lib/test/test_sets.py
+++ b/Lib/test/test_sets.py
@@ -75,10 +75,11 @@ class TestBasicOps(unittest.TestCase):
self.assertIn(v, self.values)
def test_pickling(self):
- p = pickle.dumps(self.set)
- copy = pickle.loads(p)
- self.assertEqual(self.set, copy,
- "%s != %s" % (self.set, copy))
+ for proto in range(pickle.HIGHEST_PROTOCOL + 1):
+ p = pickle.dumps(self.set, proto)
+ copy = pickle.loads(p)
+ self.assertEqual(self.set, copy,
+ "%s != %s" % (self.set, copy))
#------------------------------------------------------------------------------