PyDocs

Nav

Development Tools

Mock.call_count

unittest.mock

attribute of Mock (source)
An integer telling you how many times the mock object has been called:
1 Example
>>> mock = Mock(return_value=None)
>>> mock.call_count
0
>>> mock()
>>> mock()
>>> mock.call_count
2
from the Python docs
See Also
No see-alsos for unittest.mock/Mock.call_count
0 Notes
No notes for Mock.call_count