Skip to content

bpo-31177: Fix reset_mock on mock with deleted children#10836

Closed
eli-b wants to merge 1 commit into
python:masterfrom
eli-b:bpo-31177
Closed

bpo-31177: Fix reset_mock on mock with deleted children#10836
eli-b wants to merge 1 commit into
python:masterfrom
eli-b:bpo-31177

Conversation

@eli-b

@eli-b eli-b commented Nov 30, 2018

Copy link
Copy Markdown
Contributor

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

@eli-b

eli-b commented Nov 30, 2018

Copy link
Copy Markdown
Contributor Author

@vstinner, this is my updated PR. Sorry for the mess.

@vstinner

Copy link
Copy Markdown
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?

@eli-b

eli-b commented Dec 1, 2018

Copy link
Copy Markdown
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!

@eli-b eli-b closed this Dec 1, 2018
@vstinner

vstinner commented Dec 1, 2018

Copy link
Copy Markdown
Member

Simple, I wasn't aware of the other PR.

Oh, I see :-) You can now review / play with the PR #9302 ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants