From 6af6ba46565175ac66a8288901c711e710cc4a4a Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 22 Jan 2026 11:37:41 +0000 Subject: [PATCH] adding config env variables for pytest --- conftest.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 conftest.py diff --git a/conftest.py b/conftest.py new file mode 100644 index 00000000..ddd12575 --- /dev/null +++ b/conftest.py @@ -0,0 +1,34 @@ +# conftest.py +import os +import pytest +from backend.app.config import get_settings + + +@pytest.fixture(autouse=True, scope="session") +def fake_env(): + vars = { + "API_KEY": "test", + "SECRET_KEY": "test", + "ENVIRONMENT": "test", + "DATA_BUCKET": "test", + "PLAN_TRIGGER_BUCKET": "test", + "ENGINE_SQS_URL": "test", + "EPC_AUTH_TOKEN": "test", # Will be overwritten in CI/CD + "GOOGLE_SOLAR_API_KEY": "test", + "DB_HOST": "localhost", + "DB_USERNAME": "test", + "DB_PASSWORD": "test", + "DB_PORT": "5432", + "DB_NAME": "test", + "SAP_PREDICTIONS_BUCKET": "test", + "CARBON_PREDICTIONS_BUCKET": "test", + "HEAT_PREDICTIONS_BUCKET": "test", + "HEATING_KWH_PREDICTIONS_BUCKET": "test", + "HOTWATER_KWH_PREDICTIONS_BUCKET": "test", + "ENERGY_ASSESSMENTS_BUCKET": "test", + } + + for k, v in vars.items(): + os.environ.setdefault(k, v) + + get_settings.cache_clear()