PyDocs

Nav

Development Tools

Mock.method_calls

unittest.mock

attribute of Mock
As well as tracking calls to themselves, mocks also track calls to methods and attributes, and their methods and attributes:
1 Example
>>> mock = Mock()
>>> mock.method()
<Mock name='mock.method()' id='...'>
>>> mock.property.method.attribute()
<Mock name='mock.property.method.attribute()' id='...'>
>>> mock.method_calls
[call.method(), call.property.method.attribute()]
from the Python docs
See Also
No see-alsos for unittest.mock/Mock.method_calls
0 Notes
No notes for Mock.method_calls