bpo-32299: Return patched dict when using patch.dict as a context manager by mariocj89 · Pull Request #11062 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation27 Commits2 Checks0 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
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
Closes: #4834
This PR brings the commit from the abandoned PR #4834 with the comments addressed. See #4834 (comment)
https://bugs.python.org/issue32299
Thanks @merwok, that needed fixing indeed.
…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
@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. 🎉
@csabella These days I tend to approve some PRs but not merge them, as I lack the focus to see buildbots, handle backports, etc.
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. 🙂
DinoV pushed a commit to DinoV/cpython that referenced this pull request