You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When an async for loop contains a conditional break from the loop, and the whole loop is inside a try.. finally block (the except clause may also be present), it manifests as missing branch coverage under CPython 3.14.0b4. The branch is correctly covered under CPython 3.12.x.
This bug is very similar to #1324 (affects CPython 3.10), so I used almost the same file to reproduce. However, the loop now needs to be inside a try.. finally block to trigger.
To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
What version of Python are you using?
CPython 3.14.0b4
What version of coverage.py shows the problem? The output of coverage debug sys is helpful. coverage_version: 7.9.2
What versions of what packages do you have installed? The output of pip freeze is helpful.
Only coverage==7.9.2.
What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
Describe the bug
When an
async forloop contains a conditional break from the loop, and the whole loop is inside atry.. finallyblock (theexceptclause may also be present), it manifests as missing branch coverage under CPython 3.14.0b4. The branch is correctly covered under CPython 3.12.x.This bug is very similar to #1324 (affects CPython 3.10), so I used almost the same file to reproduce. However, the loop now needs to be inside a
try.. finallyblock to trigger.To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
What version of Python are you using?
CPython 3.14.0b4
What version of coverage.py shows the problem? The output of
coverage debug sysis helpful.coverage_version: 7.9.2What versions of what packages do you have installed? The output of
pip freezeis helpful.Only
coverage==7.9.2.What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix.
git clone,pip install, and so on. Explain like we're five!Configure branch coverage. (See Branch coverage missing in
async forloop w/break(CPython 3.10.2) #1324 for.coveragerc.)Then
Expected behavior
The same run on CPython 3.12: