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'