Skip to content

Conversation

@eli-b
Copy link
Contributor

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

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
Copy link
Contributor Author

eli-b commented Nov 30, 2018

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

@vstinner
Copy link
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
Copy link
Contributor Author

eli-b commented Dec 1, 2018

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
Copy link
Member

vstinner commented Dec 1, 2018

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