Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f5896a05
Commit
f5896a05
authored
Aug 29, 2019
by
Rémi Lapeyre
Committed by
Ned Deily
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-35946: Improve assert_called_with documentation (GH-11796)
parent
c9612782
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Doc/library/unittest.mock.rst
Doc/library/unittest.mock.rst
+2
-2
Lib/unittest/mock.py
Lib/unittest/mock.py
+1
-1
No files found.
Doc/library/unittest.mock.rst
View file @
f5896a05
...
...
@@ -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')
...
...
Lib/unittest/mock.py
View file @
f5896a05
...
...
@@ -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."""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment