Python Mock: mock calls counted by call_count
Python Mock: mock calls counted by call_count Question: Is there a way to get the mock calls counted by call_count in this example: from mock import MagicMock mock = MagicMock() mock.get_query(arg=1).execute() mock.get_query(arg=2).execute() print(‘count:’, mock.get_query.call_count) print(‘calls:’, mock.get_query.mock_calls) Actual result: count: 2 calls: [call(arg=1), call().execute(), call(arg=2), call().execute()] Desired result: count: 2 calls: [call(arg=1), call(arg=2)] I understand mock_calls. …