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

mock_calls #82

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

mock_calls #82

GoogleCodeExporter opened this issue Apr 28, 2016 · 10 comments

Comments

@GoogleCodeExporter
Copy link

Like method_calls but include calls to the mock itself and also track calls to 
return_value mocks.

Original issue reported on code.google.com by fuzzyman on 24 Mar 2011 at 12:31

@GoogleCodeExporter
Copy link
Author

Calls to magic methods should be tracked here as well.

Original comment by fuzzyman on 24 Mar 2011 at 12:33

@GoogleCodeExporter
Copy link
Author

mock_calls is a better name. The calls tracked here should be used for the repr 
as well. e.g.

  <Mock name='mock.foo().bar.baz()' >

Where the trailing () indicate that a mock is a return_value from the call of 
another mock.

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

@GoogleCodeExporter
Copy link
Author

Issue 8 has been merged into this issue.

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

@GoogleCodeExporter
Copy link
Author

Original comment by fuzzyman on 7 May 2011 at 2:33

  • Changed title: mock_calls

@GoogleCodeExporter
Copy link
Author

Original comment by fuzzyman on 18 Jun 2011 at 12:04

  • Added labels: Milestone-Release0.8

@GoogleCodeExporter
Copy link
Author

The call object should be enhanced to go with this, to make it easier to make 
assertions against mock_calls.

Original comment by fuzzyman on 17 Jul 2011 at 1:24

@GoogleCodeExporter
Copy link
Author

Note that in effect this change will "deprecate", call_args, call_args_list and 
method_calls.

"mock_calls" will be a list of tuples, it could be a list with a custom repr 
(pretty-printed).

Original comment by fuzzyman on 17 Jul 2011 at 1:26

@GoogleCodeExporter
Copy link
Author

This issue is probably dependent on issue 83.

Original comment by fuzzyman on 17 Jul 2011 at 1:26

@GoogleCodeExporter
Copy link
Author

Sorry, no. Unrelated to issue 83.

Original comment by fuzzyman on 17 Jul 2011 at 1:27

@GoogleCodeExporter
Copy link
Author

This is now implemented on head - with the following minor tasks still to be 
done:

* repr should use new name (so new name should default to name if not None)
* reset_mock should clear mock_calls (including children)
* rename _new_name and _new_parent to _mock_new_name and _mock_new_parent
* args lists (call_args_list, method_calls and mock_calls) could allow a
  membership test ('in') for lists - to see if a call chain is contained in them

Original comment by fuzzyman on 18 Jul 2011 at 12:09

  • Changed state: Fixed

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