summaryrefslogtreecommitdiff
path: root/coverage/jsonreport.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/jsonreport.py')
-rw-r--r--coverage/jsonreport.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/coverage/jsonreport.py b/coverage/jsonreport.py
index 43edc452..7ca468e3 100644
--- a/coverage/jsonreport.py
+++ b/coverage/jsonreport.py
@@ -102,4 +102,17 @@ class JsonReporter:
'covered_branches': nums.n_executed_branches,
'missing_branches': nums.n_missing_branches,
})
+ reported_file['executed_branches'] = list(
+ _convert_branch_arcs(analysis.executed_branch_arcs())
+ )
+ reported_file['missing_branches'] = list(
+ _convert_branch_arcs(analysis.missing_branch_arcs())
+ )
return reported_file
+
+
+def _convert_branch_arcs(branch_arcs):
+ """Convert branch arcs to a list of two-element tuples."""
+ for source, targets in branch_arcs.items():
+ for target in targets:
+ yield source, target if target != -1 else 0