Skip to content

Commit 612d393

Browse files
miss-islingtonRémi Lapeyre
andauthored
bpo-35946: Improve assert_called_with documentation (GH-11796)
(cherry picked from commit f5896a0) Co-authored-by: Rémi Lapeyre <[email protected]>
1 parent f3dca6a commit 612d393

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Doc/library/unittest.mock.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ the *new_callable* argument to :func:`patch`.
317317

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

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

323323
>>> mock = Mock()
324324
>>> mock.method(1, 2, 3, test='wow')

Lib/unittest/mock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ def assert_called_once(self):
854854
raise AssertionError(msg)
855855

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

0 commit comments

Comments
 (0)