We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = None created_at = <Date 2021-07-20.14:38:46.011> labels = ['3.9', 'docs'] title = 'Docs for mock.call' updated_at = <Date 2021-07-20.16:10:03.586> user = 'https://bugs.python.org/guettli'
bugs.python.org fields:
activity = <Date 2021-07-20.16:10:03.586> actor = 'xtreak' assignee = 'docs@python' closed = False closed_date = None closer = None components = ['Documentation'] creation = <Date 2021-07-20.14:38:46.011> creator = 'guettli' dependencies = [] files = [] hgrepos = [] issue_num = 44684 keywords = [] message_count = 2.0 messages = ['397874', '397887'] nosy_count = 3.0 nosy_names = ['guettli', 'docs@python', 'xtreak'] pr_nums = [] priority = 'normal' resolution = None stage = None status = 'open' superseder = None type = None url = 'https://bugs.python.org/issue44684' versions = ['Python 3.9']
The text was updated successfully, but these errors were encountered:
The docs for mock.call could get improved:
mock.call
https://docs.python.org/3/library/unittest.mock.html#call
Up to now it is not clear how to access individual members of the call.
Example: I want to check if the call used the kwarg "foo" with the value of "bar".
Usually you don't need this, since you check for the whole call (all args and all kwargs).
But sometimes you jus twant to check for a single arg/kwarg.
Then it would be nice to have more detailed docs for the class "call".
BTW: Why has this class a lower-case name? Looks a bit strange.
Sorry, something went wrong.
A call object is either a tuple of (positional args, keyword args) or (name, positional args, keyword args) depending on how it was constructed
#11807 added support for args and kwargs from python 3.9. So I guess you want to do call_object.kwargs["foo"] == "bar"
Scrolling down briefly from unittest.mock.call the page does give an example with args and kwargs
unittest.mock.call
args
kwargs
... >>> m(1, 2, 3, arg='one', arg2='two') >>> kall = m.call_args >>> kall.args (1, 2, 3) ...
Would that be good enough as an example or better to put it directly under call()?
call()
No branches or pull requests
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: