The event_loop
fixture is deprecated in pytest-asyncio
(see here). One possible approach is to use the loop_scope
marker with a group of tests.
For example:
@pytest.mark.asyncio(loop_scope="session")
class MyTestGroup:
async def test_A(self):
...
async def test_B(self):
...