summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-04 13:17:56 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-04 13:17:56 (GMT)
commitaaef34483c294c79dfc4e96f3168eea0f6b0e3f8 (patch)
tree3adaedeb8ed63c9025d0604005be73a241fab9f7 /Lib/test/pickletester.py
parent7b39b9b51baf3bc421917083f2b0451c841728bc (diff)
downloadcpython-aaef34483c294c79dfc4e96f3168eea0f6b0e3f8.zip
cpython-aaef34483c294c79dfc4e96f3168eea0f6b0e3f8.tar.gz
cpython-aaef34483c294c79dfc4e96f3168eea0f6b0e3f8.tar.bz2
#17346: make sure pickle tests are run against all protocols. Initial patch by Marius Gedminas.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 4d491b0..1ce01c3 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -577,10 +577,10 @@ class AbstractPickleTests(unittest.TestCase):
i = C()
i.attr = i
for proto in protocols:
- s = self.dumps(i, 2)
+ s = self.dumps(i, proto)
x = self.loads(s)
self.assertEqual(dir(x), dir(i))
- self.assertTrue(x.attr is x)
+ self.assertIs(x.attr, x)
def test_recursive_multi(self):
l = []
@@ -637,13 +637,13 @@ class AbstractPickleTests(unittest.TestCase):
def test_bytes(self):
for proto in protocols:
for s in b'', b'xyz', b'xyz'*100:
- p = self.dumps(s)
+ p = self.dumps(s, proto)
self.assertEqual(self.loads(p), s)
for s in [bytes([i]) for i in range(256)]:
- p = self.dumps(s)
+ p = self.dumps(s, proto)
self.assertEqual(self.loads(p), s)
for s in [bytes([i, i]) for i in range(256)]:
- p = self.dumps(s)
+ p = self.dumps(s, proto)
self.assertEqual(self.loads(p), s)
def test_ints(self):