summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-02-03 22:32:18 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-02-03 22:32:18 (GMT)
commit894453a28db899187a2b2779915ac73bd87a1051 (patch)
tree0d7535353bc13ede6d953ed84e91970805404c3d /Lib/test/pickletester.py
parent5013bd9438be9b2faa8a70c72ef57bae1fe4a031 (diff)
downloadcpython-894453a28db899187a2b2779915ac73bd87a1051.zip
cpython-894453a28db899187a2b2779915ac73bd87a1051.tar.gz
cpython-894453a28db899187a2b2779915ac73bd87a1051.tar.bz2
test_newobj_tuple(), test_newobj_list(): These tests should work under
all protocols, so tried them under all.
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 0d2441a..87acec6 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -555,19 +555,21 @@ class AbstractPickleTests(unittest.TestCase):
x = MyTuple([1, 2, 3])
x.foo = 42
x.bar = "hello"
- s = self.dumps(x, 2)
- y = self.loads(s)
- self.assertEqual(tuple(x), tuple(y))
- self.assertEqual(x.__dict__, y.__dict__)
+ for proto in protocols:
+ s = self.dumps(x, proto)
+ y = self.loads(s)
+ self.assertEqual(tuple(x), tuple(y))
+ self.assertEqual(x.__dict__, y.__dict__)
def test_newobj_list(self):
x = MyList([1, 2, 3])
x.foo = 42
x.bar = "hello"
- s = self.dumps(x, 2)
- y = self.loads(s)
- self.assertEqual(list(x), list(y))
- self.assertEqual(x.__dict__, y.__dict__)
+ for proto in protocols:
+ s = self.dumps(x, proto)
+ y = self.loads(s)
+ self.assertEqual(list(x), list(y))
+ self.assertEqual(x.__dict__, y.__dict__)
def test_newobj_generic(self):
for proto in protocols: