mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
Fix aiohttp patch to work with aiohttp >= 3.3
Aiohttp expects an awaitable instance to be returned from `ClientSession._request` though `asyncio.coroutine` decorated function do not implement `__await__`. By changing the syntax and dropping Python 3.4 support we fix this issue.
This commit is contained in:
committed by
Luiz Menezes
parent
aff71c5107
commit
e559be758a
@@ -154,3 +154,15 @@ def test_params_on_url(tmpdir, scheme):
|
||||
assert request.url == url
|
||||
assert cassette_response_json == response_json
|
||||
assert cassette.play_count == 1
|
||||
|
||||
|
||||
async def test_aiohttp_client_does_not_break_with_patching_request(aiohttp_client, tmpdir):
|
||||
async def hello(request):
|
||||
return aiohttp.web.Response(text='Hello, world')
|
||||
|
||||
app = aiohttp.web.Application()
|
||||
app.router.add_get('/', hello)
|
||||
client = await aiohttp_client(app)
|
||||
|
||||
with vcr.use_cassette(str(tmpdir.join('get.yaml'))):
|
||||
await client.get('/')
|
||||
|
||||
Reference in New Issue
Block a user