From 280dbb579e0dd122ea743c2e38b4e4c4bd5cb4f6 Mon Sep 17 00:00:00 2001 From: brian Date: Mon, 17 Mar 2025 22:46:52 +0000 Subject: [PATCH] added more explicit env var loading --- shared/repositories/tests/integration/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared/repositories/tests/integration/conftest.py b/shared/repositories/tests/integration/conftest.py index 15bde11..c759876 100644 --- a/shared/repositories/tests/integration/conftest.py +++ b/shared/repositories/tests/integration/conftest.py @@ -31,11 +31,6 @@ from shared.repositories.src.implementations import ( # set random seed for reproducibility random.seed(13) -# load local test environment variables -test_env_path = Path(__file__).parent.parent.parent.parent.parent / 'test.env' -load_dotenv(test_env_path.as_posix()) -load_dotenv(os.getenv('GITHUB_ENV', default='.')) - # define test environment variables necessary_env_vars = { 'MINIO_ENDPOINT', @@ -57,6 +52,11 @@ def setup_env( request: pytest.FixtureRequest, ) -> None: """Populate environment with variables used for testing.""" + # load in optional local test environment variables + test_env_path = Path(__file__).parent.parent.parent.parent.parent / 'test.env' + load_dotenv(test_env_path) + # load in optional CI environment variables + load_dotenv(os.getenv('GITHUB_ENV')) # check if necessary env vars are set for key in necessary_env_vars: assert key in os.environ, f'{key} not set'