summaryrefslogtreecommitdiff
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index e39fea615d..09eef8c56f 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1597,12 +1597,27 @@ order (MRO) for bases """
self.assertEqual(x2, SubSpam)
self.assertEqual(a2, a1)
self.assertEqual(d2, d1)
- with self.assertRaises(TypeError):
+
+ with self.assertRaises(TypeError) as cm:
spam_cm()
- with self.assertRaises(TypeError):
+ self.assertEqual(
+ str(cm.exception),
+ "descriptor 'classmeth' of 'xxsubtype.spamlist' "
+ "object needs an argument")
+
+ with self.assertRaises(TypeError) as cm:
spam_cm(spam.spamlist())
- with self.assertRaises(TypeError):
+ self.assertEqual(
+ str(cm.exception),
+ "descriptor 'classmeth' requires a type "
+ "but received a 'xxsubtype.spamlist' instance")
+
+ with self.assertRaises(TypeError) as cm:
spam_cm(list)
+ self.assertEqual(
+ str(cm.exception),
+ "descriptor 'classmeth' requires a subtype of 'xxsubtype.spamlist' "
+ "but received 'list'")
def test_staticmethods(self):
# Testing static methods...