Skip to content
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

Only reset actual mocks in resetall(). #88

Merged
merged 1 commit into from
Jul 17, 2017
Merged

Only reset actual mocks in resetall(). #88

merged 1 commit into from
Jul 17, 2017

Conversation

jdavisp3
Copy link
Contributor

The mocker.patch.dict method currently causes mocker.resetall() to fail, because patch.dict does not return a mock that can be reset.

  • Only append the return value of the patching function to the list of outstanding mocks if it has the reset_mock attribute.
  • Add a test verifying we can call resetall() after patching a dict.
  • Add a test verifying we can call resetall() and stopall() after other patching methods.

@nicoddemus
Copy link
Member

Awesome, thank you! I will publish a new release later. 👍

@nicoddemus nicoddemus merged commit 31077ba into pytest-dev:master Jul 17, 2017
@jdavisp3
Copy link
Contributor Author

Thanks very much!

@jdavisp3 jdavisp3 deleted the fix-resetall-for-patch-dict branch July 17, 2017 14:36
@nicoddemus
Copy link
Member

1.6.2 has just been released @jdavisp3, thanks!

@jdavisp3
Copy link
Contributor Author

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants