Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extending jsonreport.py to also include all branch attributes #966

Merged
merged 1 commit into from Apr 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Expand Up @@ -114,6 +114,7 @@ Rodrigue Cloutier
Roger Hu
Ross Lawley
Roy Williams
Salvatore Zagaria
Sandra Martocchia
Scott Belden
Sigve Tjora
Expand Down
2 changes: 2 additions & 0 deletions coverage/jsonreport.py
Expand Up @@ -60,6 +60,8 @@ def report(self, morfs, outfile=None):
self.report_data["totals"].update({
'num_branches': self.total.n_branches,
'num_partial_branches': self.total.n_partial_branches,
'covered_branches': self.total.n_executed_branches,
'missing_branches': self.total.n_missing_branches,
})

json.dump(
Expand Down
4 changes: 3 additions & 1 deletion tests/test_json.py
Expand Up @@ -65,7 +65,9 @@ def test_branch_coverage(self):
'num_branches': 2,
'excluded_lines': 0,
'num_partial_branches': 1,
'percent_covered': 60.0
'percent_covered': 60.0,
'covered_branches': 1,
'missing_branches': 1
}
}
self._assert_expected_json_report(cov, expected_result)
Expand Down