diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-15 06:38:10 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-15 06:38:10 -0400 |
commit | 19e52a9bdcfc3318efb2cdcbf1e9cf3343b3dbf8 (patch) | |
tree | 972db1acbbc684ed65af93e96f971e535e7d28c3 /coverage/xmlreport.py | |
parent | 3722bcb056f0d1bf5562d8c31341eaf0a7ae5977 (diff) | |
download | python-coveragepy-git-19e52a9bdcfc3318efb2cdcbf1e9cf3343b3dbf8.tar.gz |
Refactor the analysis results so we aren't passing so many tuples around.
Diffstat (limited to 'coverage/xmlreport.py')
-rw-r--r-- | coverage/xmlreport.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index 9898e7e1..155f7bf5 100644 --- a/coverage/xmlreport.py +++ b/coverage/xmlreport.py @@ -80,7 +80,7 @@ class XmlReporter(Reporter): # Use the DOM to write the output file. outfile.write(self.xml_out.toprettyxml()) - def xml_file(self, cu, statements, excluded_unused, missing): + def xml_file(self, cu, analysis): """Add to the XML report for a single file.""" # Create the 'lines' and 'package' XML elements, which @@ -101,14 +101,14 @@ class XmlReporter(Reporter): xclass.setAttribute("complexity", "0.0") # For each statement, create an XML 'line' element. - for line in statements: + for line in analysis.statements: l = self.xml_out.createElement("line") l.setAttribute("number", str(line)) # Q: can we get info about the number of times # a statement is executed? If so, that should be # recorded here. - l.setAttribute("hits", str(int(not line in missing))) + l.setAttribute("hits", str(int(not line in analysis.missing))) # Q: can we get info about whether this statement # is a branch? If so, that data should be @@ -116,8 +116,8 @@ class XmlReporter(Reporter): #l.setAttribute("branch", "false") xlines.appendChild(l) - class_lines = 1.0 * len(statements) - class_hits = class_lines - len(missing) + class_lines = 1.0 * len(analysis.statements) + class_hits = class_lines - len(analysis.missing) class_branches = 0.0 class_branch_hits = 0.0 |