New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-45046: Support context managers in unittest #28045
bpo-45046: Support context managers in unittest #28045
Conversation
Add methods enterContext() and enterClassContext() in TestCase. Add method enterAsyncContext() in IsolatedAsyncioTestCase. Add function enterModuleContext().
@pablogsal, I ask a permission to land this in 3.11. The PR was already ready 7 months ago, I only wanted to rewrite some tests in other issues before merging it, and missed the freeze data. |
Ok, no problem. Thanks for checking with me. I think we can make an exception here. I added the 3.11 backport label so just land it and proceed with the backport. Thanks for the great work @serhiy-storchaka |
Thanks @serhiy-storchaka for the PR |
Add methods enterContext() and enterClassContext() in TestCase. Add method enterAsyncContext() in IsolatedAsyncioTestCase. Add function enterModuleContext(). (cherry picked from commit 086c6b1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-92479 is a backport of this pull request to the 3.11 branch. |
Add methods enterContext() and enterClassContext() in TestCase. Add method enterAsyncContext() in IsolatedAsyncioTestCase. Add function enterModuleContext(). (cherry picked from commit 086c6b1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Add methods enterContext() and enterClassContext() in TestCase.
Add method enterAsyncContext() in IsolatedAsyncioTestCase.
Add function enterModuleContext().
https://bugs.python.org/issue45046