From: Tim Peters Date: Mon, 3 Feb 2003 22:32:18 +0000 (+0000) Subject: test_newobj_tuple(), test_newobj_list(): These tests should work under X-Git-Tag: v2.3c1~2062 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=894453a28db899187a2b2779915ac73bd87a1051;p=thirdparty%2FPython%2Fcpython.git test_newobj_tuple(), test_newobj_list(): These tests should work under all protocols, so tried them under all. --- diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 0d2441adc5ff..87acec6aa2fe 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: