Python: inspect interleaved unittest.mock calls with attached mocks
When you need to assert interleaved call order across several unittest.mock objects, use attached mocks: a parent mock collects child calls into one mock_calls timeline. For methods, create_autospec(..., instance=True) handles attachment automatically, while separate functions require Mock.attach_mock() to merge their mock_calls and assert the full sequence in one check.