Skip to content

bpo-45046: Support context managers in unittest#28045

Merged
serhiy-storchaka merged 10 commits into
python:mainfrom
serhiy-storchaka:unittest-entercontext
May 8, 2022
Merged

bpo-45046: Support context managers in unittest#28045
serhiy-storchaka merged 10 commits into
python:mainfrom
serhiy-storchaka:unittest-entercontext

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Aug 29, 2021

Copy link
Copy Markdown
Member

Add methods enterContext() and enterClassContext() in TestCase.
Add method enterAsyncContext() in IsolatedAsyncioTestCase.
Add function enterModuleContext().

https://bugs.python.org/issue45046

Add methods enterContext() and enterClassContext() in TestCase.
Add method enterAsyncContext() in IsolatedAsyncioTestCase.
Add function enterModuleContext().
@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Aug 29, 2021
@pablogsal pablogsal removed their request for review August 30, 2021 17:41
@ned-deily ned-deily removed the request for review from a team September 5, 2021 20:21

@asvetlov asvetlov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support this feature

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

@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.

@pablogsal pablogsal added the needs backport to 3.11 only security fixes label May 8, 2022
@pablogsal

Copy link
Copy Markdown
Member

@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 ♥️

@serhiy-storchaka serhiy-storchaka merged commit 086c6b1 into python:main May 8, 2022
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the unittest-entercontext branch May 8, 2022 14:49
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 8, 2022
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>
@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label May 8, 2022
@bedevere-bot

Copy link
Copy Markdown

GH-92479 is a backport of this pull request to the 3.11 branch.

miss-islington added a commit that referenced this pull request May 8, 2022
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants