summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-15 09:19:16 (GMT)
committerThomas Wouters <thomas@python.org>2006-04-15 09:19:16 (GMT)
commit4cdada9af61caa842cc1b04bac1968356cda7b7d (patch)
tree5ebd949a1edcd471483fecf6bcc48db6756b4cb4 /Lib/test
parent1034dadf1fb032612281f7559be2b71615e9fc9e (diff)
downloadcpython-4cdada9af61caa842cc1b04bac1968356cda7b7d.zip
cpython-4cdada9af61caa842cc1b04bac1968356cda7b7d.tar.gz
cpython-4cdada9af61caa842cc1b04bac1968356cda7b7d.tar.bz2
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')
-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 b8b4cab..601b8b4 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.