diff options
-rw-r--r-- | coverage/results.py | 4 | ||||
-rw-r--r-- | test/test_summary.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/coverage/results.py b/coverage/results.py index 138782e6..59cc1fa9 100644 --- a/coverage/results.py +++ b/coverage/results.py @@ -98,6 +98,8 @@ class Analysis(object): """Returns lines that have more than one exit.""" exit_counts = {} for l1,l2 in self.arc_possibilities(): + if l1 == -1: + continue if l1 not in exit_counts: exit_counts[l1] = 0 exit_counts[l1] += 1 @@ -107,6 +109,8 @@ class Analysis(object): def total_branches(self): exit_counts = {} for l1,l2 in self.arc_possibilities(): + if l1 == -1: + continue if l1 not in exit_counts: exit_counts[l1] = 0 exit_counts[l1] += 1 diff --git a/test/test_summary.py b/test/test_summary.py index bbf5f026..4e18e1d8 100644 --- a/test/test_summary.py +++ b/test/test_summary.py @@ -99,8 +99,8 @@ class SummaryTest(CoverageTest): # Name Stmts Exec Branch BrExec Cover # -------------------------------------------- - # mybranch 5 5 4 3 88% + # mybranch 5 5 2 1 85% self.assertEqual(self.line_count(report), 3) self.assert_("mybranch " in report) - self.assertEqual(self.last_line_squeezed(report), "mybranch 5 5 4 3 88%") + self.assertEqual(self.last_line_squeezed(report), "mybranch 5 5 2 1 85%") |