mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-10 09:35:34 +00:00
handle pytest-asyncio async def coroutines
This commit is contained in:
13
tests/integration/async_def.py
Normal file
13
tests/integration/async_def.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import aiohttp
|
||||
import pytest
|
||||
import vcr
|
||||
|
||||
|
||||
@vcr.use_cassette()
|
||||
@pytest.mark.asyncio
|
||||
async def test_http(): # noqa: E999
|
||||
async with aiohttp.ClientSession() as session:
|
||||
url = 'https://httpbin.org/get'
|
||||
params = {'ham': 'spam'}
|
||||
resp = await session.get(url, params=params) # noqa: E999
|
||||
assert (await resp.json())['args'] == {'ham': 'spam'} # noqa: E999
|
||||
Reference in New Issue
Block a user