summaryrefslogtreecommitdiff
path: root/coverage/xmlreport.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-11-03 17:38:03 -0400
committerNed Batchelder <ned@nedbatchelder.com>2012-11-03 17:38:03 -0400
commit69e0a37098edba20e24fe8fa80e6960c53e2c3c7 (patch)
treea4930e93c377e3b4641c61619fdd8f71a1b125a1 /coverage/xmlreport.py
parent3f9716518f854fc9396f815b1c3a8feb7c7397d4 (diff)
downloadpython-coveragepy-git-69e0a37098edba20e24fe8fa80e6960c53e2c3c7.tar.gz
The reporting functions now return a float, the total percentage covered.
Diffstat (limited to 'coverage/xmlreport.py')
-rw-r--r--coverage/xmlreport.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py
index 03f910c8..e062ceee 100644
--- a/coverage/xmlreport.py
+++ b/coverage/xmlreport.py
@@ -84,6 +84,9 @@ class XmlReporter(Reporter):
# Use the DOM to write the output file.
outfile.write(self.xml_out.toprettyxml())
+ # Return the total percentage.
+ return 100.0 * (lhits_tot + bhits_tot) / (lnum_tot + bnum_tot)
+
def xml_file(self, cu, analysis):
"""Add to the XML report for a single file."""