summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2003-10-28 12:05:48 (GMT)
committerArmin Rigo <arigo@tunes.org>2003-10-28 12:05:48 (GMT)
commit2b3eb4062c5e50abf854f7e68038243ca7c07217 (patch)
treefc5a73861c6e4feb4f4bc497165fa28d9c81d79f /Lib/test/test_builtin.py
parent0e4f76405d79e95abfdda21b9dfc10c7f32340e8 (diff)
downloadcpython-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_builtin.py')
-rw-r--r--Lib/test/test_builtin.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 6521634..e84cfbd 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -167,16 +167,16 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(cmp(-1, 1), -1)
self.assertEqual(cmp(1, -1), 1)
self.assertEqual(cmp(1, 1), 0)
- # verify that circular objects are handled
+ # verify that circular objects are not handled
a = []; a.append(a)
b = []; b.append(b)
from UserList import UserList
c = UserList(); c.append(c)
- self.assertEqual(cmp(a, b), 0)
- self.assertEqual(cmp(b, c), 0)
- self.assertEqual(cmp(c, a), 0)
- self.assertEqual(cmp(a, c), 0)
- # okay, now break the cycles
+ self.assertRaises(RuntimeError, cmp, a, b)
+ self.assertRaises(RuntimeError, cmp, b, c)
+ self.assertRaises(RuntimeError, cmp, c, a)
+ self.assertRaises(RuntimeError, cmp, a, c)
+ # okay, now break the cycles
a.pop(); b.pop(); c.pop()
self.assertRaises(TypeError, cmp)