diff options
author | Armin Rigo <arigo@tunes.org> | 2003-10-28 12:05:48 (GMT) |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2003-10-28 12:05:48 (GMT) |
commit | 2b3eb4062c5e50abf854f7e68038243ca7c07217 (patch) | |
tree | fc5a73861c6e4feb4f4bc497165fa28d9c81d79f /Lib/test/pickletester.py | |
parent | 0e4f76405d79e95abfdda21b9dfc10c7f32340e8 (diff) | |
download | cpython-2b3eb4062c5e50abf854f7e68038243ca7c07217.zip cpython-2b3eb4062c5e50abf854f7e68038243ca7c07217.tar.gz cpython-2b3eb4062c5e50abf854f7e68038243ca7c07217.tar.bz2 |
Deleting cyclic object comparison.
SF patch 825639
http://mail.python.org/pipermail/python-dev/2003-October/039445.html
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r-- | Lib/test/pickletester.py | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index cf1bb37..6e6d97d 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -424,9 +424,8 @@ class AbstractPickleTests(unittest.TestCase): for proto in protocols: s = self.dumps(l, proto) x = self.loads(s) - self.assertEqual(x, l) - self.assertEqual(x, x[0]) - self.assertEqual(id(x), id(x[0])) + self.assertEqual(len(x), 1) + self.assert_(x is x[0]) def test_recursive_dict(self): d = {} @@ -434,9 +433,8 @@ class AbstractPickleTests(unittest.TestCase): for proto in protocols: s = self.dumps(d, proto) x = self.loads(s) - self.assertEqual(x, d) - self.assertEqual(x[1], x) - self.assertEqual(id(x[1]), id(x)) + self.assertEqual(x.keys(), [1]) + self.assert_(x[1] is x) def test_recursive_inst(self): i = C() @@ -444,9 +442,8 @@ class AbstractPickleTests(unittest.TestCase): for proto in protocols: s = self.dumps(i, 2) x = self.loads(s) - self.assertEqual(x, i) - self.assertEqual(x.attr, x) - self.assertEqual(id(x.attr), id(x)) + self.assertEqual(dir(x), dir(i)) + self.assert_(x.attr is x) def test_recursive_multi(self): l = [] @@ -457,12 +454,10 @@ class AbstractPickleTests(unittest.TestCase): for proto in protocols: s = self.dumps(l, proto) x = self.loads(s) - self.assertEqual(x, l) - self.assertEqual(x[0], i) - self.assertEqual(x[0].attr, d) - self.assertEqual(x[0].attr[1], x) - self.assertEqual(x[0].attr[1][0], i) - self.assertEqual(x[0].attr[1][0].attr, d) + self.assertEqual(len(x), 1) + self.assertEqual(dir(x[0]), dir(i)) + self.assertEqual(x[0].attr.keys(), [1]) + self.assert_(x[0].attr[1] is x) def test_garyp(self): self.assertRaises(self.error, self.loads, 'garyp') |