pytest-asyncio
pytest-asyncio copied to clipboard
Breaking change in 0.23.*
Hello! Something has been broken with the latest pytest-asyncio releases.
Consider such code:
import asyncio
import pytest
@pytest.fixture(scope='session')
def event_loop():
loop = asyncio.get_event_loop_policy().new_event_loop()
yield loop
loop.close()
@pytest.fixture(scope='session')
async def some_async_fixture():
return asyncio.get_running_loop()
async def test_something(some_async_fixture):
assert asyncio.get_running_loop() is some_async_fixture
pytest.ini:
[pytest]
asyncio_mode = auto
This test passes with pytest-asyncio 0.21.1 but fails with 0.23.0. I am not sure if it's ok, but if it is, IMHO it is breaking change.