Skip to content

Commit

Permalink
Merge pull request #966 from SZVector/json_dump_all_attributes
Browse files Browse the repository at this point in the history
Extending jsonreport.py to also include all branch attributes
  • Loading branch information
nedbat committed Apr 11, 2020
2 parents 42344f3 + f5eb5f2 commit b1194fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Expand Up @@ -115,6 +115,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

0 comments on commit b1194fb

Please sign in to comment.