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
unittest.mock.call object has inherited count method #65469
Comments
The unittest.mock.call object inherits methods from tuple that prevent you using them as normal call attributes. They should be overridden. |
To start with I am overriding count and index method. Do you think this is enough? |
Those are the only ones I think. Thanks. |
Forgot to attach the patch. Includes NEWS entry. Overriden methods count() and index(). |
Thanks for this Kushal. It's not quite right though, count and index need to do the same as other attributes looked up with __getattr__. In fact delegating to __getattr__ is probably the easiest way of achieving that. (With the current patch the calls will be incorrect for call.foo.index() or similar I believe.) |
Uploading the second version of the patch. |
New changeset 5660c1bdc2b6 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: