diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-02-03 22:32:18 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-02-03 22:32:18 (GMT) |
commit | 894453a28db899187a2b2779915ac73bd87a1051 (patch) | |
tree | 0d7535353bc13ede6d953ed84e91970805404c3d /Lib/test/pickletester.py | |
parent | 5013bd9438be9b2faa8a70c72ef57bae1fe4a031 (diff) | |
download | cpython-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.py | 18 |
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: |