diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0169946..c304d6f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,3 +21,5 @@ jobs: python-version: ${{ matrix.python-version }} - run: pip install -e . pytest - run: pytest tests/ -v + env: + SWATGENX_API_KEY: ${{ secrets.SWATGENX_API_KEY }} diff --git a/tests/test_public.py b/tests/test_public.py index 746f4d3..f58cba7 100644 --- a/tests/test_public.py +++ b/tests/test_public.py @@ -87,7 +87,9 @@ def test_access_info_ladder(): assert len(info.get("tiers", [])) == 4 -def test_client_requires_key(): +def test_client_requires_key(monkeypatch): + # Client falls back to SWATGENX_API_KEY, which CI now sets; clear it so this still tests the no-key path. + monkeypatch.delenv("SWATGENX_API_KEY", raising=False) with pytest.raises(sg.SwatGenXError, match="API key"): sg.Client(api_key="")