diff options
Diffstat (limited to 'Doc/library/unittest.mock-examples.rst')
| -rw-r--r-- | Doc/library/unittest.mock-examples.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/unittest.mock-examples.rst b/Doc/library/unittest.mock-examples.rst index 60db4c2ba4..16690f3498 100644 --- a/Doc/library/unittest.mock-examples.rst +++ b/Doc/library/unittest.mock-examples.rst @@ -166,6 +166,15 @@ You use the :data:`call` object to construct lists for comparing with >>> mock.mock_calls == expected True +However, parameters to calls that return mocks are not recorded, which means it is not +possible to track nested calls where the parameters used to create ancestors are important: + + >>> m = Mock() + >>> m.factory(important=True).deliver() + <Mock name='mock.factory().deliver()' id='...'> + >>> m.mock_calls[-1] == call.factory(important=False).deliver() + True + Setting Return Values and Attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
