This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients Julian, brett.cannon, chris.jerdonek, daniel.urban, eric.araujo, ezio.melotti, martin.panter, michael.foord, pablomouzo, parkouss, pitrou, r.david.murray, rbcollins
Date 2014-10-13.02:31:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
[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.
Date User Action Args
2014-10-13 02:31:42martin.pantersetrecipients: + martin.panter, brett.cannon, pitrou, rbcollins, ezio.melotti, eric.araujo, r.david.murray, michael.foord, pablomouzo, daniel.urban, chris.jerdonek, Julian, parkouss
2014-10-13 02:31:42martin.pantersetmessageid: <>
2014-10-13 02:31:42martin.panterlinkissue11664 messages
2014-10-13 02:31:42martin.pantercreate