]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make test_class work (but still fail) even though class.__dict__ is now a
authorThomas Wouters <thomas@python.org>
Sat, 15 Apr 2006 09:19:16 +0000 (09:19 +0000)
committerThomas Wouters <thomas@python.org>
Sat, 15 Apr 2006 09:19:16 +0000 (09:19 +0000)
'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.

Lib/test/test_class.py

index b8b4cab96d3e66fef8447da0ee79d05b1d5913b2..601b8b4f8ec95a389e783bf58eb4b5ee09845245 100644 (file)
@@ -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.