-
-
Notifications
You must be signed in to change notification settings - Fork 456
Closed
Labels
Description
Describe the bug
Using pattern matching with branch coverage shows missing exit.
Name Stmts Miss Branch BrPart Cover Missing
--------------------------------------------------------
example.py 8 0 4 1 92% 5->exit
--------------------------------------------------------
TOTAL 8 0 4 1 92%
To Reproduce
Answer the questions below:
- What version of Python are you using?
Python 3.13.5 - What version of coverage.py shows the problem? The output of
coverage debug sys
is helpful.
Coverage.py, version 7.10.6 with C extension - What versions of what packages do you have installed? The output of
pip freeze
is helpful.
coverage==7.10.6 - 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.
def fn(value):
match value:
case int():
print('int')
case str():
print('str')
fn(1)
fn('hello')
- What commands should we run to reproduce the problem? Be specific. Include everything, even
git clone
,pip install
, and so on. Explain like we're five!
coverage run --branch example.py
coverage report -m
Expected behavior
100% coverage