summaryrefslogtreecommitdiff
path: root/Lib/test/test_class.py
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-15 09:19:16 +0000
committerThomas Wouters <thomas@python.org>2006-04-15 09:19:16 +0000
commit25ac3e6924040de27f33ab850787c75f2d248e2e (patch)
treed74b6eb8372c7f75ac68545a4a981e6304c3f768 /Lib/test/test_class.py
parent0ab3264590791ddbc42a3e54140a1d6e5b1d5add (diff)
downloadcpython-25ac3e6924040de27f33ab850787c75f2d248e2e.tar.gz
Make test_class work (but still fail) even though class.__dict__ is now a
'dictproxy' (which is a read-only non-dict mapping type that can't be passed to exec.) The failures the test finds are behavioural differences between old- and new-style classes that may or may not be intended.
Diffstat (limited to 'Lib/test/test_class.py')
-rw-r--r--Lib/test/test_class.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py
index b8b4cab96d..601b8b4f8e 100644
--- a/Lib/test/test_class.py
+++ b/Lib/test/test_class.py
@@ -115,9 +115,12 @@ def __%(method)s__(self, *args):
print "__%(method)s__:", args
"""
+d = {}
for method in testmeths:
- exec method_template % locals() in AllTests.__dict__
-
+ exec method_template % locals() in d
+for k in d:
+ setattr(AllTests, k, d[k])
+del d, k
del method, method_template
# this also tests __init__ of course.