Commit 88dd3f6
Tighten live-test selection: source-inspection on public getters
The "auto-mark every test that doesn't take requests_mock" heuristic
was overkill — out of 244 collected tests it marked 200, including
every pure unit test of internal helpers (rdb parsing, _to_str, CQL
filter splitting, NWIS_Metadata setters, validation logic, etc).
Marker over-application is cheap on the success path but conveys
the wrong intent and is one more thing to keep in sync.
Refined heuristic: a test is live iff
(a) it does not take requests_mock as a fixture, AND
(b) its function-body source references one of the package's public
user-facing getters (the _PUBLIC_GETTERS set — all `get_*` /
`what_*` entry points exposed by waterdata, wqp, samples, nadp,
streamstats, nldi, nwis, and ngwmn modules).
The set is maintained explicitly because there's no programmatic way
for the conftest to know "what counts as a user-facing entry point";
adding a new public getter means adding it here. A regex with `\b`
word boundaries avoids matching internal helpers that happen to
share a prefix (e.g. `_get_args` won't match `get_args`).
Dry-run against the current test inventory:
- Old heuristic marked: 200 / 244
- New heuristic marked: 89 / 244
- Now-unmarked unit tests: 111
Spot-checked the 111 de-marked tests — all are genuinely offline:
rdb_test.py parsers, utils_test.py to_str/BaseMetadata/datetime
helpers, waterdata_filters_test.py CQL-filter logic, nldi_test.py
validators, nwis_test.py metadata setters, etc.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8906299 commit 88dd3f6
1 file changed
Lines changed: 93 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
15 | 25 | | |
16 | 26 | | |
17 | | - | |
18 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
19 | 95 | | |
20 | 96 | | |
21 | 97 | | |
| |||
32 | 108 | | |
33 | 109 | | |
34 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
35 | 117 | | |
36 | 118 | | |
37 | 119 | | |
| |||
0 commit comments