Martin Panter added the comment:

[padding to avoid UTF-8 error with bug tracker]

See also Issue 22374, where an equivalent of “patch.object” is suggested as an 
example context manager for the “contextlib” documentation.

If we added a plain function or context manager rather than a new TestCase 
method, it might avoid the worries about bloating the API. Then it could be a 
generic thing for any kind of testing, and not coupled with the “unittest” 
framework.

About cleanup functions more generally, I think they already tie in well with 
the TestCase.addCleanup() API. Perhaps it could handle general context managers 
as well though, by inheriting an ExitStack.enter_context() method or providing 
an ExitStack attribute.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11664>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to