@asyncio.coroutine
def aiohttp_request(session, method, url, as_text, **kwargs):
- response = yield from session.request(method, url, **kwargs)
- return response, (yield from response.text()) if as_text else (yield from response.json())
+ response = yield from session.request(method, url, **kwargs) # NOQA: E999
+ return response, (yield from response.text()) if as_text else (yield from response.json()) # NOQA: E999
class MockClientResponse(ClientResponse):
# TODO: get encoding from header
@asyncio.coroutine
- def json(self, *, encoding='utf-8', loads=json.loads):
+ def json(self, *, encoding='utf-8', loads=json.loads): # NOQA: E999
return loads(self.content.decode(encoding))
@asyncio.coroutine
response.close()
return response
- response = yield from real_request(self, method, url, **kwargs)
+ response = yield from real_request(self, method, url, **kwargs) # NOQA: E999
vcr_response = {
'status': {
'message': response.reason,
},
'headers': dict(response.headers),
- 'body': {'string': (yield from response.text())},
+ 'body': {'string': (yield from response.text())}, # NOQA: E999
'url': response.url,
}
cassette.append(vcr_request, vcr_response)