Commit 803fa14
committed
ci(#2484): use 'pragma: lax no cover' for timing-dependent exception catches
The two catches I touched in the previous commit
(``except asyncio.CancelledError`` and
``except anyio.ClosedResourceError`` in the teardown result-collection
loop) turn out to be timing-dependent:
- On Windows the teardown of the background reader/writer finishes
before the loop reaches ``await task``, so ``await task`` never
raises CancelledError / ClosedResourceError and the branches are
unreached — needs pragma.
- On some Linux runs the reader/writer is still running when we
cancel and await, so the branches *are* reached — strict-no-cover
complained that a plain ``pragma: no cover`` was wrong there.
Switched both to ``pragma: lax no cover``, which the project's
coverage config already defines as the opt-out marker for exactly
this case (exists on other lines in the same file, e.g. 247).
It is excluded from coverage reporting but does not trip
strict-no-cover when the line happens to be hit.1 parent 3483015 commit 803fa14
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
0 commit comments