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

track everything in method_calls #8

Closed
GoogleCodeExporter opened this issue Apr 28, 2016 · 2 comments
Closed

track everything in method_calls #8

GoogleCodeExporter opened this issue Apr 28, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

- track everything in method_calls, eg:

>>> m = Mock()
>>> m()
<Mock ...>
>>> m.method_calls
[('__call__',)]

...so I don't have to check m.call_args_list *and* m.method_calls to make
sure that nothing has been called on m itself that shouldn't have been.

Original issue reported on code.google.com by cwith...@gmail.com on 9 Dec 2008 at 12:54

@GoogleCodeExporter
Copy link
Author

That should be straightforward to add.

I can also add child return value calls as well - which gets you halfway to 
issue 9.

Suggested output:

>>> m = Mock()
>>> m().something().other()
>>> m.method_calls
[('__call__', (), {}), ('().something', (), {}), ('().something().other', (), 
{})]

The question is whether this would pollute method calls too much for people who
prefer to track them separately? (Adding '__call__' is straightforward - it is 
the
extension of this that I wonder about.)

Original comment by fuzzyman on 9 Dec 2008 at 12:26

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

This feature request is now being tracked in issue 82.

Original comment by fuzzyman on 28 Mar 2011 at 12:18

  • Changed state: Duplicate

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

No branches or pull requests

1 participant