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
commit4cdada9af61caa842cc1b04bac1968356cda7b7d (patch)
tree5ebd949a1edcd471483fecf6bcc48db6756b4cb4 /Lib/test/test_class.py
parent1034dadf1fb032612281f7559be2b71615e9fc9e (diff)
downloadcpython-git-4cdada9af61caa842cc1b04bac1968356cda7b7d.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.