diff --git a/fastfood/config.py b/fastfood/config.py index d3ac037..208f480 100644 --- a/fastfood/config.py +++ b/fastfood/config.py @@ -2,7 +2,7 @@ from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): - DB_HOST: str = "localhost" + DB_HOST: str = "db" DB_PORT: int = 5432 POSTGRES_DB: str = "fastfod_db" POSTGRES_PASSWORD: str = "postgres" diff --git a/fastfood/cruds/submenu.py b/fastfood/cruds/submenu.py index 4e6a4ee..b4edde0 100644 --- a/fastfood/cruds/submenu.py +++ b/fastfood/cruds/submenu.py @@ -26,7 +26,7 @@ class SubMenuCrud: session.add(new_submenu) await session.flush() await session.commit() - return new_submenu + return new_submenu @staticmethod async def get_submenu_item( diff --git a/tests/conftest.py b/tests/conftest.py index 9b0b01b..136265b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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() diff --git a/tests/test_crud.py b/tests/test_crud.py index a8afdbf..faf8a45 100644 --- a/tests/test_crud.py +++ b/tests/test_crud.py @@ -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)