Commit 894453a2 authored by Tim Peters's avatar Tim Peters

test_newobj_tuple(), test_newobj_list(): These tests should work under

all protocols, so tried them under all.
parent 5013bd94
...@@ -555,19 +555,21 @@ class AbstractPickleTests(unittest.TestCase): ...@@ -555,19 +555,21 @@ class AbstractPickleTests(unittest.TestCase):
x = MyTuple([1, 2, 3]) x = MyTuple([1, 2, 3])
x.foo = 42 x.foo = 42
x.bar = "hello" x.bar = "hello"
s = self.dumps(x, 2) for proto in protocols:
y = self.loads(s) s = self.dumps(x, proto)
self.assertEqual(tuple(x), tuple(y)) y = self.loads(s)
self.assertEqual(x.__dict__, y.__dict__) self.assertEqual(tuple(x), tuple(y))
self.assertEqual(x.__dict__, y.__dict__)
def test_newobj_list(self): def test_newobj_list(self):
x = MyList([1, 2, 3]) x = MyList([1, 2, 3])
x.foo = 42 x.foo = 42
x.bar = "hello" x.bar = "hello"
s = self.dumps(x, 2) for proto in protocols:
y = self.loads(s) s = self.dumps(x, proto)
self.assertEqual(list(x), list(y)) y = self.loads(s)
self.assertEqual(x.__dict__, y.__dict__) self.assertEqual(list(x), list(y))
self.assertEqual(x.__dict__, y.__dict__)
def test_newobj_generic(self): def test_newobj_generic(self):
for proto in protocols: for proto in protocols:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment