summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-05-01 13:51:46 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-05-01 13:51:46 (GMT)
commit8fbd2954583cbf252999991d7c58e4deacb2688c (patch)
treeff64dc8a51441dc21961c04a69b1e80fa759c254 /Lib
parent49a69e4d48d68a36325ba9098e1962e8c2195339 (diff)
parent7295c6a871f9cc42a4209a8eebe2e0974194a2a3 (diff)
downloadcpython-8fbd2954583cbf252999991d7c58e4deacb2688c.zip
cpython-8fbd2954583cbf252999991d7c58e4deacb2688c.tar.gz
cpython-8fbd2954583cbf252999991d7c58e4deacb2688c.tar.bz2
merge 3.2 (#14699)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_descr.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index b9b1c72..079f60b 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1466,6 +1466,22 @@ order (MRO) for bases """
self.assertEqual(x, spam.spamlist)
self.assertEqual(a, a1)
self.assertEqual(d, d1)
+ spam_cm = spam.spamlist.__dict__['classmeth']
+ x2, a2, d2 = spam_cm(spam.spamlist, *a, **d)
+ self.assertEqual(x2, spam.spamlist)
+ self.assertEqual(a2, a1)
+ self.assertEqual(d2, d1)
+ class SubSpam(spam.spamlist): pass
+ x2, a2, d2 = spam_cm(SubSpam, *a, **d)
+ self.assertEqual(x2, SubSpam)
+ self.assertEqual(a2, a1)
+ self.assertEqual(d2, d1)
+ with self.assertRaises(TypeError):
+ spam_cm()
+ with self.assertRaises(TypeError):
+ spam_cm(spam.spamlist())
+ with self.assertRaises(TypeError):
+ spam_cm(list)
def test_staticmethods(self):
# Testing static methods...