Another option is to create a simple list and append each mock to it through side_effect
.
@mock.patch(method_1)
@mock.patch(method_2)
def test_call_order(method_2_mock, method_1_mock):
call_order = []
method_1_mock.side_effect = lambda *a, **kw: call_order.append(method_1_mock)
method_2_mock.side_effect = lambda *a, **kw: call_order.append(method_2_mock)
# Run test code...
assert call_order == [method_1_mock, method_2_mock]
Each time the method is called, the side_effect
lambda function is called. Since lists are ordered, this is a clean way to check the call order of your methods.