bpo-31177: Fix reset_mock on mock with deleted children#10836
Closed
eli-b wants to merge 1 commit intopython:masterfrom
Closed
bpo-31177: Fix reset_mock on mock with deleted children#10836eli-b wants to merge 1 commit intopython:masterfrom
eli-b wants to merge 1 commit intopython:masterfrom
Conversation
Contributor
Author
|
@vstinner, this is my updated PR. Sorry for the mess. |
Member
|
I don't understand why you are writing a new PR whereas there is already PR #9302 which is going to be merged soon? |
Contributor
Author
|
Simple, I wasn't aware of the other PR. As I wrote in the bpo, this is an issue I originally opened a PR for back in 2016 on testing-cabal's repo, and only 3 days ago was I informed development of unittest.mock moved here. Good luck merging the other PR! |
Member
Oh, I see :-) You can now review / play with the PR #9302 ;-) |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, calling reset_mock() on a unittest.mock.Mock object after one of its attributes was deleted causes an exception.
This fixes the exception. Note deleted attributes stay deleted after a reset_mock() call, which might be surprising to the user.
https://bugs.python.org/issue31177
https://bugs.python.org/issue31177