Skip to content

test: prune tautological + redundant tests (stacked on #334)#335

Merged
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/prune-tests
Jun 24, 2026
Merged

test: prune tautological + redundant tests (stacked on #334)#335
thodson-usgs merged 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/prune-tests

Conversation

@thodson-usgs

Copy link
Copy Markdown
Collaborator

Draft, stacked on #334. The first commit is #334 (mock the live NWIS
tests); the net-new change here is the second commit (the prune). The diff
below reduces to just the prune once #334 merges.

What this prunes

Once #334 mocked the live NWIS tests, two classes became tautological — they
assert the columns/shape of the fixture they're handed, with no production logic
between the mock and the assertion that isn't already covered elsewhere:

  • nwis_test.py::TestSiteseriesCatalogOutput (Parameter code not returned from site information #34) — RDB column parsing is
    covered by rdb_test.py + TestReadRdb; and since the mock returns the chosen
    fixture regardless of the request, the seriesCatalogOutput param itself is
    never exercised. Deleted (+ the orphaned nwis_site_seriescatalog.txt fixture
    and now-unused imports).
  • nwis_test.py::TestTZ (Error when combining Dataframe from stations with different time zones #60) — once mocked it is identical to
    test_iv_service_answer (same nwis_iv_mock.json, same "datetime index"
    assertion); the two [:25]/[:20] variants differ only by a slice the mock
    ignores. Deleted.
  • waterdata_filters_test.py::test_construct_filter_passthroughfilter
    is forwarded verbatim, so it's subsumed by the parametrized
    test_construct_filter_on_all_ogc_services (8 services + filter-lang) and by
    the long-filter fan-out tests. Deleted.

Net: −8 tests, no coverage lost.

Whole-suite review

I ran a 4-agent review across all 17 test files (~7,800 lines) with strict,
conservative criteria (tautological / redundant / vacuous / dead). The suite is
well-curated — the deletions above are the only defensible ones. Notable
kept items and why:

  • nwis_test.py::TestMetaData (6 near-identical assert md.site_info) — each
    passes a distinct major filter through NWIS_Metadata; kept (only low-confidence
    redundancy).
  • waterservices_test.py::*_site_value_types (4) — verify each getter accepts
    both sites="x" and sites=["x"]; a real per-getter input contract.
  • waterdata_test.py::test_get_samples_legacy_camelcase_kwargs_warn — the only
    test asserting the DeprecationWarning fires on a real get_samples call
    end-to-end (the mapping-wide tests use a spy / suppress warnings).
  • wqp_test.py what_* (8) — identical boilerplate assertions, but each is the
    sole check that a public wrapper maps to the right service string; a
    parametrize-refactor candidate, not a prune.
  • chunking / progress / nearest / ratings / nldi / ngwmn — each test pins a
    distinct branch; nothing cut.

Verification

nwis_test.py + waterdata_filters_test.py: 118 passed, offline, ruff/mypy
clean.

🤖 Generated with Claude Code

Follow-up to DOI-USGS#334 (mocking the live NWIS tests). Once mocked, two NWIS classes
became tautological — they assert the columns/shape of the fixture they feed,
exercising no production logic the mocked-out parse doesn't already cover:

- nwis_test.py: delete TestSiteseriesCatalogOutput (DOI-USGS#34 — RDB column parsing is
  covered by rdb_test.py + TestReadRdb, and the seriesCatalogOutput param is not
  exercised because the mock returns the fixture regardless) and TestTZ (DOI-USGS#60 —
  now identical to test_iv_service_answer: same fixture, same datetime-index
  assertion). Drop the orphaned nwis_site_seriescatalog.txt fixture and the
  now-unused imports.
- waterdata_filters_test.py: delete test_construct_filter_passthrough — `filter`
  is forwarded verbatim, so it is subsumed by the parametrized
  test_construct_filter_on_all_ogc_services (8 services + filter-lang) and the
  long-filter fan-out tests.

A 4-agent review of the full suite (17 files) found the rest well-curated; these
are the only defensible deletions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sjb14HkwuCydKSKMsaXsgd
@thodson-usgs thodson-usgs marked this pull request as ready for review June 24, 2026 20:32
@thodson-usgs thodson-usgs merged commit 3847edd into DOI-USGS:main Jun 24, 2026
9 checks passed
@thodson-usgs thodson-usgs deleted the chore/prune-tests branch June 24, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant