This commit is contained in:
2024-01-29 04:35:37 +03:00
parent 1b5182b41a
commit b5da5736e9
4 changed files with 6 additions and 4 deletions

View File

@@ -25,7 +25,10 @@ async_session_maker = async_sessionmaker(
@pytest.fixture(scope="session")
def event_loop():
loop = asyncio.get_event_loop_policy().new_event_loop()
try:
loop = asyncio.get_event_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
yield loop
loop.close()

View File

@@ -53,4 +53,3 @@ async def test_submenu(asession: AsyncSession) -> None:
submenu = await SubMenuCrud.create_submenu_item(
menu_id, menubaseschema.model_validate(submenu), asession,
)
print(submenu)