mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
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.
This commit is contained in:
parent
1034dadf1f
commit
4cdada9af6
1 changed files with 5 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue