[issue9110] contextlib.ContextDecorator
Nick Coghlan
report at bugs.python.org
Tue Jun 29 16:06:41 CEST 2010
Nick Coghlan <ncoghlan at gmail.com> added the comment:
Looks pretty good to me, but you may want to doublecheck some of your test criteria.
Firstly, the two "*_with_exception" checks don't look quite right to me. I would have expected to see something like the following for both of them:
self.assertIsNotNone(context.exc)
self.assertIs(context.exc[0], NameError).
Secondly, I can't even begin to guess what the method decoration test is currently trying to show. Why 3 instantiations? Why check the instance assignments rather than the context manager behaviour? Either I'm completely missing something, or this currently isn't testing what you meant to test :)
Finally, you may as well include a second typo test to cover the __enter__ misspelling case.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9110>
_______________________________________
More information about the Python-bugs-list
mailing list