test: prune tautological + redundant tests (stacked on #334)#335
Merged
Conversation
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
cf55620 to
7a831f3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 iscovered by
rdb_test.py+TestReadRdb; and since the mock returns the chosenfixture regardless of the request, the
seriesCatalogOutputparam itself isnever exercised. Deleted (+ the orphaned
nwis_site_seriescatalog.txtfixtureand now-unused imports).
nwis_test.py::TestTZ(Error when combiningDataframefrom stations with different time zones #60) — once mocked it is identical totest_iv_service_answer(samenwis_iv_mock.json, same "datetime index"assertion); the two
[:25]/[:20]variants differ only by a slice the mockignores. Deleted.
waterdata_filters_test.py::test_construct_filter_passthrough—filteris forwarded verbatim, so it's subsumed by the parametrized
test_construct_filter_on_all_ogc_services(8 services +filter-lang) and bythe 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-identicalassert md.site_info) — eachpasses a distinct major filter through
NWIS_Metadata; kept (only low-confidenceredundancy).
waterservices_test.py::*_site_value_types(4) — verify each getter acceptsboth
sites="x"andsites=["x"]; a real per-getter input contract.waterdata_test.py::test_get_samples_legacy_camelcase_kwargs_warn— the onlytest asserting the
DeprecationWarningfires on a realget_samplescallend-to-end (the mapping-wide tests use a spy / suppress warnings).
wqp_test.pywhat_*(8) — identical boilerplate assertions, but each is thesole check that a public wrapper maps to the right service string; a
parametrize-refactor candidate, not a prune.
distinct branch; nothing cut.
Verification
nwis_test.py+waterdata_filters_test.py: 118 passed, offline, ruff/mypyclean.
🤖 Generated with Claude Code