diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-30 21:35:27 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-30 21:35:27 -0500 |
commit | 9d2b8a09154727bee8c2296ea5852574c22a16cb (patch) | |
tree | 1a43543ed896e037776a218456ec421125547121 /coverage/html.py | |
parent | 62cd957d5ff36fa745affac27d23be7d7928b40b (diff) | |
download | python-coveragepy-git-9d2b8a09154727bee8c2296ea5852574c22a16cb.tar.gz |
A little explanation of the partial branch annotations in the HTML report.
Diffstat (limited to 'coverage/html.py')
-rw-r--r-- | coverage/html.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/coverage/html.py b/coverage/html.py index 6df84a57..3671f036 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -80,7 +80,8 @@ class HtmlReporter(Reporter): lineno += 1 # 1-based line numbers. # Figure out how to mark this line. line_class = "" - annotate = "" + annotate_html = "" + annotate_title = "" if lineno in analysis.statements: line_class += " stm" if lineno in analysis.excluded: @@ -96,7 +97,11 @@ class HtmlReporter(Reporter): annlines.append("exit") else: annlines.append(str(b)) - annotate = " ".join(annlines) + annotate_html = " ".join(annlines) + if len(annlines) > 1: + annotate_title = "no jumps to these line numbers" + elif len(annlines) == 1: + annotate_title = "no jump to this line number" elif lineno in analysis.statements: line_class += c_run @@ -113,7 +118,8 @@ class HtmlReporter(Reporter): 'html': html, 'number': lineno, 'class': line_class.strip() or "pln", - 'annotate': annotate, + 'annotate': annotate_html, + 'annotate_title': annotate_title, }) # Write the HTML page for this file. |