From 894453a28db899187a2b2779915ac73bd87a1051 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Mon, 3 Feb 2003 22:32:18 +0000 Subject: [PATCH] test_newobj_tuple(), test_newobj_list(): These tests should work under all protocols, so tried them under all. --- Lib/test/pickletester.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 0d2441adc5f..87acec6aa2f 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: