PyDocs

Nav

Development Tools

Mock.assert_called_with

  • Mock.assert_called_with(*args, **kwargs)
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.
1 Example
>>> mock = Mock()
>>> mock.method(1, 2, 3, test='wow')
<Mock name='mock.method()' id='...'>
>>> mock.method.assert_called_with(1, 2, 3, test='wow')
from the Python docs
See Also
No see-alsos for unittest.mock/Mock.assert_called_with
0 Notes
No notes for Mock.assert_called_with