From 21e36438a54ede7e1da48272372dfbdcd3307791 Mon Sep 17 00:00:00 2001 From: Vahid Rafiei Date: Mon, 28 Sep 2026 20:56:37 +0200 Subject: [PATCH 1/2] CI passes the SWATGENX_API_KEY secret, so the two groundwater tests run again The secret holds a dedicated test account's API key. Without it the two tests skip (PR #1); with it they call the signed-in well-record endpoint for real. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0165nvw7C6jpq45EnoiEHE7S --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) 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 }} From 83ef9c371b56f90aead0c993332f0fa380703e07 Mon Sep 17 00:00:00 2001 From: Vahid Rafiei Date: Mon, 28 Sep 2026 20:57:58 +0200 Subject: [PATCH 2/2] test_client_requires_key clears SWATGENX_API_KEY, which CI now sets Client falls back to the environment variable, so with the CI secret present Client(api_key="") no longer raised (run 36468776367: DID NOT RAISE). Clearing it keeps the test on the no-key path, as the keyless groundwater test does. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0165nvw7C6jpq45EnoiEHE7S --- tests/test_public.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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="")