summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-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}