Summary
tests/ngwmn_test.py (added in #324) is a file of tests that hit the live NGWMN OGC API on every run, rather than mocking with httpx_mock + tests/data/ fixtures.
The convention it breaks
AGENTS.md → Testing Gotchas:
Tests mock HTTP with pytest-httpx's httpx_mock fixture and fixtures under tests/data/; keep new API tests offline.
The doc treats live tests as named exceptions (e.g. tests/nwis_test.py::test_nwis_service_live) and reiterates under Conventions: "tests should mock with httpx_mock." tests/ngwmn_test.py is instead an entire file of live tests — its module docstring says "These hit the live NGWMN OGC API …"; every getter test (get_sites/get_water_level/get_providers/get_lithology/get_well_construction) makes real requests, and test_state_queryables_still_diverge_upstream does a direct httpx.get(.../queryables).
Why it matters
Scope / tension
Not unique to NGWMN: tests/waterdata_test.py is also substantially live (only a minority use httpx_mock), so the "offline" rule isn't uniformly enforced today. Worth picking a direction and applying it consistently.
Proposed
- Add offline
httpx_mock-based tests for the five NGWMN getters using recorded GeoJSON response fixtures under tests/data/ (mirroring mocked cases like tests/waterdata_test.py::test_mock_get_samples).
- If a live check is still wanted, keep at most a small, explicitly-named/gated live smoke test (like
test_nwis_service_live); the test_state_queryables_still_diverge_upstream pin can remain live but be marked as the deliberate live exception.
- (Optional, separate) extend the same offline treatment to the live Water Data getter tests for consistency.
Raised from a code review of #324.
Summary
tests/ngwmn_test.py(added in #324) is a file of tests that hit the live NGWMN OGC API on every run, rather than mocking withhttpx_mock+tests/data/fixtures.The convention it breaks
AGENTS.md→ Testing Gotchas:The doc treats live tests as named exceptions (e.g.
tests/nwis_test.py::test_nwis_service_live) and reiterates under Conventions: "tests should mock withhttpx_mock."tests/ngwmn_test.pyis instead an entire file of live tests — its module docstring says "These hit the live NGWMN OGC API …"; every getter test (get_sites/get_water_level/get_providers/get_lithology/get_well_construction) makes real requests, andtest_state_queryables_still_diverge_upstreamdoes a directhttpx.get(.../queryables).Why it matters
503s unrelated to the code change.Scope / tension
Not unique to NGWMN:
tests/waterdata_test.pyis also substantially live (only a minority usehttpx_mock), so the "offline" rule isn't uniformly enforced today. Worth picking a direction and applying it consistently.Proposed
httpx_mock-based tests for the five NGWMN getters using recorded GeoJSON response fixtures undertests/data/(mirroring mocked cases liketests/waterdata_test.py::test_mock_get_samples).test_nwis_service_live); thetest_state_queryables_still_diverge_upstreampin can remain live but be marked as the deliberate live exception.Raised from a code review of #324.