]> granicus.if.org Git - python/commitdiff
bpo-35946: Improve assert_called_with documentation (GH-11796)
authorRémi Lapeyre <remi.lapeyre@henki.fr>
Thu, 29 Aug 2019 06:15:53 +0000 (08:15 +0200)
committerNed Deily <nad@python.org>
Thu, 29 Aug 2019 06:15:53 +0000 (02:15 -0400)
Doc/library/unittest.mock.rst
Lib/unittest/mock.py

index 19e9715102bf3a5615495ee3695ffedf065b0d01..304ba532274ddb03a885de263354a009bdb66f0c 100644 (file)
@@ -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')
index 5846eeb404d2fbd1d03ca4aa8f47ea231c199324..c6771ce5291af420fa5f31e398d833e0c497289d 100644 (file)
@@ -888,7 +888,7 @@ class NonCallableMock(Base):
             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."""