Skip to content

Commit

Permalink
chore: Update skip condition for integration tests (#260)
Browse files Browse the repository at this point in the history
* chore: Tweak integration tests

* Have settings ignore empty string values for environment variables
  • Loading branch information
jstlaurent authored Jan 31, 2025
1 parent 5520fe8 commit 6747c58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion polaris/hub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
9 changes: 5 additions & 4 deletions tests/test_hub_integration.py
Original file line number Diff line number Diff line change
@@ -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():
Expand All @@ -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():
Expand Down

0 comments on commit 6747c58

Please sign in to comment.