Fix pytest-asyncio warning regarding event loop fixture

This commit is contained in:
François Voron
2023-04-14 15:49:58 +02:00
parent 4bd618503b
commit cefcb7a433

View File

@ -128,9 +128,9 @@ class UserManagerMock(BaseTestUserManager[models.UP]):
@pytest.fixture(scope="session") @pytest.fixture(scope="session")
def event_loop(): def event_loop():
"""Force the pytest-asyncio loop to be the main one."""
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
yield loop yield loop
loop.close()
AsyncMethodMocker = Callable[..., MagicMock] AsyncMethodMocker = Callable[..., MagicMock]