Comment 2 for bug 1639039

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

Actually it raises an interesitng question of use. Given:

def callback(request, context):
    resp = requests.get('http://example.com')
    context.status_code = resp.status_code
    return resp.text

with requests_mock.Mocker(real_http=True) as mock:
    mock.post('http://foo.org', text=callback)
    mock.get('http://example.com', text='abc')

    print requests.post('http://foo.org')

would we expect the request made in callback() to trigger the mock created at the higher level? I guess so, but it's an odd case.