-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-32299: Return patched dict when using patch.dict as a context manager #11062
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
Conversation
070e22f
to
fc2ec3f
Compare
Thanks @merwok, that needed fixing indeed. |
e8c75a7
to
78db402
Compare
78db402
to
8f8a95f
Compare
0988491
to
eefbf07
Compare
…ager Return the patched version of the dict when `unittest.mock.patch.dict` is used as a context manager. This change mirrors the rest of the APIs that patch objects in `unittest.mock` Co-authored-by: Vadim Tsander <ts.taiye@gmail.com>
eefbf07
to
9320c85
Compare
@merwok ready for another review. Also, are you around the PyCon sprints? |
I am not at PyCon! A note about PRs for the future: it’s best for reviewers if you add commits, including merge commits, so that we can easily see changes done after reviews. We always squash merge for CPython so no worry about history cleanliness while the PR is open :) |
@merwok, it looks like this one is ready to merge. Were you waiting on anything else? Thanks! |
Would it be possible to get this merged? This would be a nice little addition for 3.8 Thanks |
@csabella These days I tend to approve some PRs but not merge them, as I lack the focus to see buildbots, handle backports, etc. |
Bases on @merwok's earlier approval, I'll merge this. If additional changes need to be made, they can be done in a new PR. Thanks, @mariocj89 for the contribution and @merwok for the review. And thanks, @tirkarthi for the nudge. 🎉 |
That's good to know. I try not to step on others work by merging changes they have been working on, but if you would like me to merge your approvals, I'd be happy to help. Just ping me to let me know. 🙂 |
Return the patched version of the dict when
unittest.mock.patch.dict
is used as a context manager. This change mirrors the rest of the APIs that patch objects inunittest.mock
Closes: #4834
This PR brings the commit from the abandoned PR #4834 with the comments addressed. See #4834 (comment)
https://bugs.python.org/issue32299