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/test_copy.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/test_copy.py')
-rw-r--r-- | Lib/test/test_copy.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py index 3d44304..6e32ddd 100644 --- a/Lib/test/test_copy.py +++ b/Lib/test/test_copy.py @@ -272,10 +272,10 @@ class TestCopy(unittest.TestCase): x = [] x.append(x) y = copy.deepcopy(x) - self.assertEqual(y, x) + self.assertRaises(RuntimeError, cmp, y, x) self.assert_(y is not x) - self.assert_(y[0] is not x[0]) - self.assert_(y is y[0]) + self.assert_(y[0] is y) + self.assertEqual(len(y), 1) def test_deepcopy_tuple(self): x = ([1, 2], 3) @@ -288,7 +288,7 @@ class TestCopy(unittest.TestCase): x = ([],) x[0].append(x) y = copy.deepcopy(x) - self.assertEqual(y, x) + self.assertRaises(RuntimeError, cmp, y, x) self.assert_(y is not x) self.assert_(y[0] is not x[0]) self.assert_(y[0][0] is y) @@ -304,10 +304,10 @@ class TestCopy(unittest.TestCase): x = {} x['foo'] = x y = copy.deepcopy(x) - self.assertEqual(y, x) + self.assertRaises(RuntimeError, cmp, y, x) self.assert_(y is not x) self.assert_(y['foo'] is y) - self.assertEqual(y, {'foo': y}) + self.assertEqual(len(y), 1) def test_deepcopy_keepalive(self): memo = {} |