mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 11:16:24 +00:00
figleaf_htmlizer: when all counts are zero, claim 0% instead of 100%, since it probably means that coverage checking has failed completely
This commit is contained in:
parent
b6712fa41f
commit
0650e5543f
@ -108,7 +108,7 @@ def report_as_html(coverage, directory, exclude_patterns=[], root=None):
|
|||||||
try:
|
try:
|
||||||
pcnt = n_covered * 100. / n_lines
|
pcnt = n_covered * 100. / n_lines
|
||||||
except ZeroDivisionError:
|
except ZeroDivisionError:
|
||||||
pcnt = 100
|
pcnt = 0
|
||||||
info_dict[k] = (n_lines, n_covered, pcnt, display_filename)
|
info_dict[k] = (n_lines, n_covered, pcnt, display_filename)
|
||||||
|
|
||||||
html_outfile = make_html_filename(display_filename)
|
html_outfile = make_html_filename(display_filename)
|
||||||
@ -139,7 +139,7 @@ def report_as_html(coverage, directory, exclude_patterns=[], root=None):
|
|||||||
summary_lines = sum([ v[0] for (k, v) in info_dict_items])
|
summary_lines = sum([ v[0] for (k, v) in info_dict_items])
|
||||||
summary_cover = sum([ v[1] for (k, v) in info_dict_items])
|
summary_cover = sum([ v[1] for (k, v) in info_dict_items])
|
||||||
|
|
||||||
summary_pcnt = 100
|
summary_pcnt = 0
|
||||||
if summary_lines:
|
if summary_lines:
|
||||||
summary_pcnt = float(summary_cover) * 100. / float(summary_lines)
|
summary_pcnt = float(summary_cover) * 100. / float(summary_lines)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user