diff --git a/backend/handler/tests/conftest.py b/backend/handler/tests/conftest.py index 4f0fc4ae9..410945cbc 100644 --- a/backend/handler/tests/conftest.py +++ b/backend/handler/tests/conftest.py @@ -11,7 +11,7 @@ engine = create_engine(ConfigLoader.get_db_engine(), pool_pre_ping=True) session = sessionmaker(bind=engine, expire_on_commit=False) -@pytest.fixture(scope="session", autouse=True) +@pytest.fixture(scope="session") def setup_database(): alembic.config.main(argv=["upgrade", "head"]) diff --git a/backend/main.py b/backend/main.py index da666fc73..908f56b6f 100644 --- a/backend/main.py +++ b/backend/main.py @@ -40,6 +40,8 @@ def startup() -> None: if __name__ == "__main__": + # Run migrations alembic.config.main(argv=["upgrade", "head"]) + + # Run application uvicorn.run("main:app", host=DEV_HOST, port=DEV_PORT, reload=True) - # uvicorn.run("main:app", host=DEV_HOST, port=DEV_PORT, reload=False, workers=2)