mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 17:15:35 +00:00
fix flake8: ignore yield from syntax errors
This commit is contained in:
@@ -3,5 +3,5 @@ import asyncio
|
|||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def aiohttp_request(session, method, url, as_text, **kwargs):
|
def aiohttp_request(session, method, url, as_text, **kwargs):
|
||||||
response = yield from session.request(method, url, **kwargs)
|
response = yield from session.request(method, url, **kwargs) # NOQA: E999
|
||||||
return response, (yield from response.text()) if as_text else (yield from response.json())
|
return response, (yield from response.text()) if as_text else (yield from response.json()) # NOQA: E999
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from vcr.request import Request
|
|||||||
class MockClientResponse(ClientResponse):
|
class MockClientResponse(ClientResponse):
|
||||||
# TODO: get encoding from header
|
# TODO: get encoding from header
|
||||||
@asyncio.coroutine
|
@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))
|
return loads(self.content.decode(encoding))
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
@@ -58,7 +58,7 @@ def vcr_request(cassette, real_request):
|
|||||||
response.close()
|
response.close()
|
||||||
return response
|
return response
|
||||||
|
|
||||||
response = yield from real_request(self, method, url, **kwargs)
|
response = yield from real_request(self, method, url, **kwargs) # NOQA: E999
|
||||||
|
|
||||||
vcr_response = {
|
vcr_response = {
|
||||||
'status': {
|
'status': {
|
||||||
@@ -66,7 +66,7 @@ def vcr_request(cassette, real_request):
|
|||||||
'message': response.reason,
|
'message': response.reason,
|
||||||
},
|
},
|
||||||
'headers': dict(response.headers),
|
'headers': dict(response.headers),
|
||||||
'body': {'string': (yield from response.text())},
|
'body': {'string': (yield from response.text())}, # NOQA: E999
|
||||||
'url': response.url,
|
'url': response.url,
|
||||||
}
|
}
|
||||||
cassette.append(vcr_request, vcr_response)
|
cassette.append(vcr_request, vcr_response)
|
||||||
|
|||||||
Reference in New Issue
Block a user