-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
reset_mock needs parameters to also reset return_value and side_effect #65470
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
Comments
unittest.mock.Mock.reset_mock deliberately doesn't reset the return_value and side_effect. It would be nice if it gained parameters so that it *could*. |
Working on it. Will submit the patch tomorrow. |
A patch without NEWS and whatsnew update. I will fill them before commit. The reset_mock function now has two parameters, return_value, and side_effect. Passing True value to any of these will reset that attribute. |
I left a couple of comments of Rietveld. |
Updated patch with the suggestions from Berker. |
New changeset b110dd3d6cea by Kushal Das in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: