FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-150484: Add test for mock_open __exit__ with contextlib.ExitStack by factnn · Pull Request #150521 · python/cpython · GitHub

Repository navigation

gh-150484: Add test for mock_open __exit__ with contextlib.ExitStack - #150521

Open
factnn wants to merge 1 commit into
python:mainfrom
factnn:fix/mock-open-exit-signature
Open

factnn wants to merge 1 commit into
python:mainfrom
factnn:fix/mock-open-exit-signature

Conversation

factnn commented May 27, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown

Follow-up to the review: only the regression test is kept on main.

The mock_open.__exit__ bug only affects 3.13 and 3.14. It was fixed on those branches directly — GH-151829 for 3.14 (merged), backported to 3.13 as GH-151861 (merged) — so Lib/unittest/mock.py needs no change on main.

Verified locally on main (00348be) that the new test passes without modifying Lib/unittest/mock.py, i.e. main never exhibited the bug; the test guards against a regression towards the 3.13/3.14 behaviour.

No NEWS entry: there is no user-facing change on main.

factnn requested a review from cjw296 as a code owner May 27, 2026 16:18

bedevere-app Bot commented May 27, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

python-cla-bot Bot commented May 27, 2026 •
edited
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Only 3.13 and 3.14 need a fix. So please open a new PR for 3.14 only.

After merging that PR, keep only test in this PR.

factnn commented Jun 8, 2026

Copy link
Copy Markdown
Author

Hi, is there anything else needed for this PR? All CI checks pass and the CLA is signed. Thanks!

Copy link
Copy Markdown
Member

Please open a new PR for the 3.14 branch.

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Sep 11, 2026
…Stack

mock_open().__exit__ only misbehaves on 3.13 and 3.14, where it was
fixed directly by pythonGH-151829 and backported as pythonGH-151861. Only the
regression test belongs on main.
factnn force-pushed the fix/mock-open-exit-signature branch from 27616f2 to 80151ba Compare October 21, 2026 07:48

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

factnn commented Oct 21, 2026

Copy link
Copy Markdown
Author

The 3.14 PR requested in review is GH-151829 (merged 2026-06-21) and its 3.13 backport GH-151861 also landed, so the fix is covered. As suggested, I have now reduced this PR to the test only — the Lib/unittest/mock.py change and the NEWS entry are dropped. Thanks!

factnn changed the title gh-150484: Fix mock_open __exit__ with contextlib.ExitStack gh-150484: Add test for mock_open __exit__ with contextlib.ExitStack Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL