summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorMichael Foord <michael@voidspace.org.uk>2012-03-25 17:16:07 (GMT)
committerMichael Foord <michael@voidspace.org.uk>2012-03-25 17:16:07 (GMT)
commit313f85f0ca1adb198e1cf7c012f7f0d1692339ae (patch)
tree15e37f08c1a05ba14ec5233af56f4693d6f00441 /Lib/unittest/test
parent1d5617958fa4e3e1039c62cbe15565e642a9e428 (diff)
downloadcpython-313f85f0ca1adb198e1cf7c012f7f0d1692339ae.zip
cpython-313f85f0ca1adb198e1cf7c012f7f0d1692339ae.tar.gz
cpython-313f85f0ca1adb198e1cf7c012f7f0d1692339ae.tar.bz2
unittest.mock.MagicMock objects are now unorderable by default
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/testmock/testmagicmethods.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testmagicmethods.py b/Lib/unittest/test/testmock/testmagicmethods.py
index 65d2711..bd52e25 100644
--- a/Lib/unittest/test/testmock/testmagicmethods.py
+++ b/Lib/unittest/test/testmock/testmagicmethods.py
@@ -156,6 +156,19 @@ class TestMockingMagicMethods(unittest.TestCase):
self. assertTrue(mock <= 3)
self. assertTrue(mock >= 3)
+ self.assertRaises(TypeError, lambda: MagicMock() < object())
+ self.assertRaises(TypeError, lambda: object() < MagicMock())
+ self.assertRaises(TypeError, lambda: MagicMock() < MagicMock())
+ self.assertRaises(TypeError, lambda: MagicMock() > object())
+ self.assertRaises(TypeError, lambda: object() > MagicMock())
+ self.assertRaises(TypeError, lambda: MagicMock() > MagicMock())
+ self.assertRaises(TypeError, lambda: MagicMock() <= object())
+ self.assertRaises(TypeError, lambda: object() <= MagicMock())
+ self.assertRaises(TypeError, lambda: MagicMock() <= MagicMock())
+ self.assertRaises(TypeError, lambda: MagicMock() >= object())
+ self.assertRaises(TypeError, lambda: object() >= MagicMock())
+ self.assertRaises(TypeError, lambda: MagicMock() >= MagicMock())
+
def test_equality(self):
for mock in Mock(), MagicMock():