summaryrefslogtreecommitdiff
path: root/coverage/results.py
diff options
context:
space:
mode:
authorBradley Burns <56638814+bradb423@users.noreply.github.com>2022-01-22 20:14:23 +0000
committerGitHub <noreply@github.com>2022-01-22 12:14:23 -0800
commitcbe2e205dac99f20afff4ccdeca21fd10d596565 (patch)
tree565406a74160d301741556397c43473e38459014 /coverage/results.py
parent2cc2254581dad57719b155b4d349d4f6fdd65d2d (diff)
downloadpython-coveragepy-git-cbe2e205dac99f20afff4ccdeca21fd10d596565.tar.gz
feat: add "lcov" command for generating LCOV reports
* Add LCOV functionality into coverage.py * Add testing for the LCOV reporter * Add documentation for the LCOV reporter
Diffstat (limited to 'coverage/results.py')
-rw-r--r--coverage/results.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/coverage/results.py b/coverage/results.py
index 7bb4781c..9675bff9 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -136,6 +136,21 @@ class Analysis:
mba[l1].append(l2)
return mba
+ @contract(returns='dict(int: list(int))')
+ def executed_branch_arcs(self):
+ """Return arcs that were executed from branch lines.
+
+ Returns {l1:[l2a,l2b,...], ...}
+
+ """
+ executed = self.arcs_executed()
+ branch_lines = set(self._branch_lines())
+ eba = collections.defaultdict(list)
+ for l1, l2 in executed:
+ if l1 in branch_lines:
+ eba[l1].append(l2)
+ return eba
+
@contract(returns='dict(int: tuple(int, int))')
def branch_stats(self):
"""Get stats about branches.