Skip to content

Commit f5896a0

Browse files
Rémi Lapeyrened-deily
authored andcommitted
bpo-35946: Improve assert_called_with documentation (GH-11796)
1 parent c961278 commit f5896a0

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
@@ -888,7 +888,7 @@ def assert_called_once(self):
888888
raise AssertionError(msg)
889889

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

0 commit comments

Comments
 (0)