PyDocs

Nav

Development Tools

Mock.called

unittest.mock

attribute of Mock (source)
A boolean representing whether or not the mock object has been called:
1 Example
>>> mock = Mock(return_value=None)
>>> mock.called
False
>>> mock()
>>> mock.called
True
from the Python docs
See Also
No see-alsos for unittest.mock/Mock.called
0 Notes
No notes for Mock.called