New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support pytest_aiohttp
#26
Comments
If you just define your own fixture in conftest.py will that work? from aresponses import ResponsesMockServer
@pytest.fixture
async def aresponses(loop):
async with ResponsesMockServer(loop=loop) as server:
yield server |
Yes, it works, thank you. I think it's a nice resolution. Should I create a PR with readme update with additional example for aresponses+aiohttp_client or there is no reason for it? |
That would be great thank you! |
Yet pytest-asyncio is included in the setup.py as installs_requires. |
Also, latest pytest releases will await coroutines just fine without pytest-asyncio. |
@XayOn do you have some documentation that shows pytest now supports asyncio? I found this which implies it doesn’t. |
At the present
pytest_aiohttp
doesn't work correct withpytest_asyncio
(pytest_aiohttp issue and pytest_asyncio issue ).On the other hand
aresponses
doesn't requirepytest_asyncio
directly and can be executed without it. Butaresponses
depends onevent_loop
fixture here. So the main questions - can we use existing fixtureevent_loop
from asyncio orloop
from aiohttp on the fly for thearesponses
fixture initialization?The text was updated successfully, but these errors were encountered: