Skip to content

Commit a46db4f

Browse files
authored
Capitalize first word in unittest.mock.assert_* docs and docstrings (#151951)
1 parent ee78d43 commit a46db4f

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

Doc/library/unittest.mock.rst

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

346346
.. method:: assert_any_call(*args, **kwargs)
347347

348-
assert the mock has been called with the specified arguments.
348+
Assert the mock has been called with the specified arguments.
349349

350350
The assert passes if the mock has *ever* been called, unlike
351351
:meth:`assert_called_with` and :meth:`assert_called_once_with` that
@@ -360,7 +360,7 @@ the *new_callable* argument to :func:`patch`.
360360

361361
.. method:: assert_has_calls(calls, any_order=False)
362362

363-
assert the mock has been called with the specified calls.
363+
Assert the mock has been called with the specified calls.
364364
The :attr:`mock_calls` list is checked for the calls.
365365

366366
If *any_order* is false then the calls must be

Lib/unittest/mock.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ def _call_matcher(self, _call):
935935
return _call
936936

937937
def assert_not_called(self):
938-
"""assert that the mock was never called.
938+
"""Assert that the mock was never called.
939939
"""
940940
if self.call_count != 0:
941941
msg = ("Expected '%s' to not have been called. Called %s times.%s"
@@ -945,15 +945,15 @@ def assert_not_called(self):
945945
raise AssertionError(msg)
946946

947947
def assert_called(self):
948-
"""assert that the mock was called at least once
948+
"""Assert that the mock was called at least once.
949949
"""
950950
if self.call_count == 0:
951951
msg = ("Expected '%s' to have been called." %
952952
(self._mock_name or 'mock'))
953953
raise AssertionError(msg)
954954

955955
def assert_called_once(self):
956-
"""assert that the mock was called only once.
956+
"""Assert that the mock was called only once.
957957
"""
958958
if not self.call_count == 1:
959959
msg = ("Expected '%s' to have been called once. Called %s times.%s"
@@ -963,7 +963,7 @@ def assert_called_once(self):
963963
raise AssertionError(msg)
964964

965965
def assert_called_with(self, /, *args, **kwargs):
966-
"""assert that the last call was made with the specified arguments.
966+
"""Assert that the last call was made with the specified arguments.
967967
968968
Raises an AssertionError if the args and keyword args passed in are
969969
different to the last call to the mock."""
@@ -985,7 +985,7 @@ def _error_message():
985985

986986

987987
def assert_called_once_with(self, /, *args, **kwargs):
988-
"""assert that the mock was called exactly once and that call was
988+
"""Assert that the mock was called exactly once and that call was
989989
with the specified arguments."""
990990
if not self.call_count == 1:
991991
msg = ("Expected '%s' to be called once. Called %s times.%s"
@@ -997,7 +997,7 @@ def assert_called_once_with(self, /, *args, **kwargs):
997997

998998

999999
def assert_has_calls(self, calls, any_order=False):
1000-
"""assert the mock has been called with the specified calls.
1000+
"""Assert the mock has been called with the specified calls.
10011001
The `mock_calls` list is checked for the calls.
10021002
10031003
If `any_order` is False (the default) then the calls must be
@@ -1042,7 +1042,7 @@ def assert_has_calls(self, calls, any_order=False):
10421042

10431043

10441044
def assert_any_call(self, /, *args, **kwargs):
1045-
"""assert the mock has been called with the specified arguments.
1045+
"""Assert the mock has been called with the specified arguments.
10461046
10471047
The assert passes if the mock has *ever* been called, unlike
10481048
`assert_called_with` and `assert_called_once_with` that only pass if

0 commit comments

Comments
 (0)