added more explicit env var loading
Code Quality Pipeline / Check Code (pull_request) Failing after 3m45s
Code Quality Pipeline / Check Code (pull_request) Failing after 3m45s
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user