From 82213596f5301981ea59c3067f8738ff9dd54bbc Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 27 Jul 2021 19:55:26 -0400 Subject: fix: match/case will trace the default case line --- coverage/parser.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'coverage/parser.py') 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) -- cgit v1.2.1