diff --git a/polaris/hub/settings.py b/polaris/hub/settings.py index 6603ecfa..1870dfa6 100644 --- a/polaris/hub/settings.py +++ b/polaris/hub/settings.py @@ -34,7 +34,9 @@ class PolarisHubSettings(BaseSettings): """ # Configuration of the pydantic model - model_config = SettingsConfigDict(env_file=".env", env_prefix="POLARIS_", extra="ignore") + model_config = SettingsConfigDict( + env_file=".env", env_prefix="POLARIS_", extra="ignore", env_ignore_empty=True + ) # Hub settings hub_url: HttpUrlString = "https://polarishub.io/" diff --git a/tests/test_hub_integration.py b/tests/test_hub_integration.py index 831d266b..9f52a030 100644 --- a/tests/test_hub_integration.py +++ b/tests/test_hub_integration.py @@ -1,14 +1,15 @@ -import os - import pytest import polaris as po from polaris.benchmark._base import BenchmarkSpecification from polaris.dataset._base import BaseDataset +from polaris.hub.settings import PolarisHubSettings + +settings = PolarisHubSettings() @pytest.mark.skipif( - os.getenv("POLARIS_PASSWORD") is None and os.getenv("POLARIS_USER") is None, + settings.username is None or settings.password is None, reason="This test case requires headless authentication to be set up", ) def test_load_dataset_flow(): @@ -17,7 +18,7 @@ def test_load_dataset_flow(): @pytest.mark.skipif( - os.getenv("POLARIS_PASSWORD") is None and os.getenv("POLARIS_USER") is None, + settings.username is None or settings.password is None, reason="This test case requires headless authentication to be set up", ) def test_load_benchmark_flow():