Repository navigation
Commit 8ad7236
fix: stop counting the try/else line when a with statement raises (#2301)
* Stop branch arcs at RERAISE so a raised with does not cover try/else.
On Python 3.14 the not-taken with handler was walked into the following
jump and the else line was reported as covered.
Co-authored-by: Cursor <[email protected]>
* Skip PyPy exception-handler line events that land on the try/else line.
Co-authored-by: Cursor <[email protected]>
* Wrap the PyPy opcode check so ruff format accepts it.
* Cover the PyPy line skip and the no-fall-through branch.
* Skip the opcode test when the interpreter has no PUSH_EXC_INFO.
* Satisfy pylint and the type checker in the opcode test.
* Narrow the opcode to int before building the fake code bytes.
* Remove the useless pylint suppression on the opcode assertion.
Co-authored-by: Cursor <[email protected]>
* Run the reraise sample so the test file is fully covered.
Co-authored-by: Cursor <[email protected]>
* Import the opcode name only when the seeded revert has not removed it.
Co-authored-by: Cursor <[email protected]>
* Skip the arc test when the seeded revert removes the no-fall-through set.
Co-authored-by: Cursor <[email protected]>
* Type the seeded no-fall-through fallback as a set of ints.
Co-authored-by: Cursor <[email protected]>
* Build the seeded fallback set without redefining the imported name.
Co-authored-by: Cursor <[email protected]>
* Exclude the seeded-only test lines from coverage.
Co-authored-by: Cursor <[email protected]>
* Use the metacov exclude pragma for the seeded-only lines.
Co-authored-by: Cursor <[email protected]>
* no need for this deep a test of the PyPy fix
* tweak the changelog
---------
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Ned Batchelder <[email protected]>1 parent c6dab1f commit 8ad7236
4 files changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| 210 | + | |
| 211 | + | |
206 | 212 | | |
207 | 213 | | |
208 | 214 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
257 | 260 | | |
258 | 261 | | |
259 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
260 | 272 | | |
261 | 273 | | |
262 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
351 | 375 | | |
352 | 376 | | |
353 | 377 | | |
| |||
0 commit comments