Describe the bug
the combination of things in the title results in coverage treating a line as covered when it is most certainly not! the toy example below is minimized from this file here
To Reproduce
I am using coverage 7.16.1 (with no config) on linux x86_64 -- all pythons below are on the latest released patch version where not specified
import contextlib
def main():
raise SystemExit()
def example():
try:
with contextlib.ExitStack():
main()
except SystemExit as e:
return 1
else:
raise RuntimeError('!!!') # incorrectly covered with sysmon!
example()
in python 3.14 and above I get the following (incorrect) output (notice line 13 is incorrectly marked as covered):
$ venv314/bin/coverage erase
$ venv314/bin/coverage run --branch t.py
$ venv314/bin/coverage report --show-missing --include t.py
Name Stmts Miss Branch BrPart Cover Missing
---------------------------------------------------
t.py 11 0 0 0 100%
---------------------------------------------------
TOTAL 11 0 0 0 100%
Expected behavior
in python 3.13 and below I get the following (correct) output:
$ venv313/bin/coverage erase
$ venv313/bin/coverage run --branch t.py
$ venv313/bin/coverage report --show-missing --include t.py
Name Stmts Miss Branch BrPart Cover Missing
---------------------------------------------------
t.py 11 1 0 0 91% 13
---------------------------------------------------
TOTAL 11 1 0 0 91%
Additional context
found while debugging pyflakes coverage
Describe the bug
the combination of things in the title results in
coveragetreating a line as covered when it is most certainly not! the toy example below is minimized from this file hereTo Reproduce
I am using coverage 7.16.1 (with no config) on linux x86_64 -- all pythons below are on the latest released patch version where not specified
in python 3.14 and above I get the following (incorrect) output (notice line 13 is incorrectly marked as covered):
Expected behavior
in python 3.13 and below I get the following (correct) output:
Additional context
found while debugging pyflakes coverage