Skip to content

Commit

Permalink
bpo-35946: Improve assert_called_with documentation (pythonGH-11796)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Lapeyre authored and ned-deily committed Aug 29, 2019
1 parent c961278 commit f5896a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ the *new_callable* argument to :func:`patch`.

.. method:: assert_called_with(*args, **kwargs)

This method is a convenient way of asserting that calls are made in a
particular way:
This method is a convenient way of asserting that the last call has been
made in a particular way:

>>> mock = Mock()
>>> mock.method(1, 2, 3, test='wow')
Expand Down
2 changes: 1 addition & 1 deletion Lib/unittest/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ def assert_called_once(self):
raise AssertionError(msg)

def assert_called_with(self, /, *args, **kwargs):
"""assert that the mock was called with the specified arguments.
"""assert that the last call was made with the specified arguments.
Raises an AssertionError if the args and keyword args passed in are
different to the last call to the mock."""
Expand Down

0 comments on commit f5896a0

Please sign in to comment.