summaryrefslogtreecommitdiff
path: root/coverage/parser.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-07-27 19:55:26 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-07-27 19:55:26 -0400
commit82213596f5301981ea59c3067f8738ff9dd54bbc (patch)
tree496c6bac3cdf8b3c6fbe7b475c41fc2915080431 /coverage/parser.py
parentc6d9eb99dfe398bc404509fc8cfc3757bdbe4b89 (diff)
downloadpython-coveragepy-git-82213596f5301981ea59c3067f8738ff9dd54bbc.tar.gz
fix: match/case will trace the default case line
Diffstat (limited to 'coverage/parser.py')
-rw-r--r--coverage/parser.py3
1 files changed, 0 insertions, 3 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index ed049685..18458147 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -1022,12 +1022,9 @@ class AstArcAnalyzer:
exits = set()
had_wildcard = False
for case in node.cases:
- # The wildcard case doesn't execute the pattern.
case_start = self.line_for_node(case.pattern)
if isinstance(case.pattern, ast.MatchAs):
had_wildcard = True
- if case.pattern.name is None:
- case_start = self.line_for_node(case.body[0])
self.add_arc(last_start, case_start, "the pattern on line {lineno} always matched")
from_start = ArcStart(case_start, cause="the pattern on line {lineno} never matched")
exits |= self.add_body_arcs(case.body, from_start=from_start)