Commit 9338291
committed
tests: close the docs test modules' branch-coverage gaps
CI requires 100% branch coverage over tests/ as well as src/, and the
new docs test modules left four statements and a handful of branch arcs
uncovered.
The statements were real gaps, each closed by making the test stronger
rather than weaker:
- test_deploy: the shared-key-different-name test now also lands the
retry back on the instance that minted the token and asserts it
completes. That is the half of the story the page tells, and it is
exactly what the sibling default-key test already proved.
- test_troubleshooting: two decorated functions whose bodies can never
run (one's decoration is what raises; the other is the duplicate that
gets dropped) now have docstring-only bodies, and the
connection-fails case enters the client explicitly with __aenter__()
(the shape tests/client/test_client.py already uses) instead of an
`async with` whose body is unreachable by design.
The rest were not real: every remaining flagged line executes (zero
missed statements); coverage.py misattributes arcs around nested
`async with` bodies on newer Pythons, worst on 3.14, which is exactly
the case AGENTS.md documents for `# pragma: no branch` (branch arcs
only; ~180 existing uses across src/ and tests/). Six of those, one of
them on a straight-line test that raises nothing at all.
./scripts/test (the CI-equivalent gate) now reports 100.00% and
strict-no-cover passes.1 parent 7d3ea3b commit 9338291
3 files changed
Lines changed: 18 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
166 | 170 | | |
167 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
| |||
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 118 | + | |
| 119 | + | |
122 | 120 | | |
123 | 121 | | |
124 | 122 | | |
| |||
140 | 138 | | |
141 | 139 | | |
142 | 140 | | |
143 | | - | |
144 | | - | |
145 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
146 | 144 | | |
147 | 145 | | |
148 | 146 | | |
| |||
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
155 | | - | |
| 153 | + | |
| 154 | + | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
247 | 246 | | |
248 | 247 | | |
249 | 248 | | |
250 | | - | |
251 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
0 commit comments