테스트, 배포, 성능 최적화 - Part 3
·
파이썬/Fast API
테스트 구현테스트는 애플리케이션의 안정성을 보장하는 핵심입니다. pytest를 활용하여 체계적인 테스트를 구현해보겠습니다.# tests/conftest.pyimport pytestfrom httpx import AsyncClientfrom sqlalchemy.ext.asyncio import AsyncSession, create_async_enginefrom sqlalchemy.orm import sessionmakerfrom app.main import appfrom app.api import depsfrom app.db.base import BaseTEST_DATABASE_URL = "postgresql+asyncpg://test:test@localhost/test_db"@pytest.fixture(..