diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-03 17:38:03 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-03 17:38:03 -0400 |
commit | 82f9dd6e35c811eb53051f70ebf51bea2740f9dd (patch) | |
tree | e740f7b5fdfac184d1605ec6f3e04dd762d095bb /coverage/xmlreport.py | |
parent | bfd262d2065b18fee48e5407059c4c47e71be308 (diff) | |
download | python-coveragepy-82f9dd6e35c811eb53051f70ebf51bea2740f9dd.tar.gz |
The reporting functions now return a float, the total percentage covered.
Diffstat (limited to 'coverage/xmlreport.py')
-rw-r--r-- | coverage/xmlreport.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index 03f910c..e062cee 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.""" |