Comment 1 for bug 1639039

Revision history for this message
Jamie Lennox (jamielennox) wrote :

Interesting, I had never considered this case.

What's happening is the mocking is there are two levels of mocking, mocking send() when you call Mocker and mocking get_adapter only for the period of that fake send() call. If you get NoMockAdress with real_http the send process unmocks the get_adapter call and then re-issues the send with the real adapter.

Because callback is being invoked from the mocked adapter calling the inner requests.get send() is then mocking get_adapter again. This means that when the inner function tries to do a real_http it is restoring the outer get_adapter function and re-issuing the call to another mocked adapter.

I'll have a look and see if there's a way we can do some sort of depth tracking or something to solve this case.