From d2c1f6c41aee9efda2679b873dfeb4e8427cfbe2 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Thu, 3 Aug 2023 12:57:16 -0400 Subject: [PATCH] Small tweaks from reivew --- backend/handler/tests/conftest.py | 2 +- backend/main.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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)