summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-02-27 17:56:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-02-27 17:56:22 (GMT)
commit1ca73ede26e05b656787122fea3ce9bd01a5f7f7 (patch)
treec11a10410920180770bdf012794f9bf9d81b4725 /Lib/test
parentb7f27ff9ac4f594c7ec3fe2cca44725cb36ffb2d (diff)
downloadcpython-1ca73ede26e05b656787122fea3ce9bd01a5f7f7.zip
cpython-1ca73ede26e05b656787122fea3ce9bd01a5f7f7.tar.gz
cpython-1ca73ede26e05b656787122fea3ce9bd01a5f7f7.tar.bz2
Merged revisions 78505-78506 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r78505 | benjamin.peterson | 2010-02-27 11:40:01 -0600 (Sat, 27 Feb 2010) | 1 line only accept AttributeError as indicating no __prepare__ attribute on a metaclass, allowing lookup errors to propogate ........ r78506 | benjamin.peterson | 2010-02-27 11:41:13 -0600 (Sat, 27 Feb 2010) | 1 line check PyDict_New() for error ........
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_metaclass.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_metaclass.py b/Lib/test/test_metaclass.py
index 000bcf5..219ab99 100644
--- a/Lib/test/test_metaclass.py
+++ b/Lib/test/test_metaclass.py
@@ -230,6 +230,20 @@ Make sure it works with subclassing.
42
>>>
+Test failures in looking up the __prepare__ method work.
+ >>> class ObscureException(Exception):
+ ... pass
+ >>> class FailDescr:
+ ... def __get__(self, instance, owner):
+ ... raise ObscureException
+ >>> class Meta(type):
+ ... __prepare__ = FailDescr()
+ >>> class X(metaclass=Meta):
+ ... pass
+ Traceback (most recent call last):
+ [...]
+ test.test_metaclass.ObscureException
+
"""
__test__ = {'doctests' : doctests}