From 852c6a7398fb5934b22dbe078f7cb2914bc4e0cd Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 22 Jul 2015 09:12:21 -0400 Subject: The DTD is no longer valid. Don't reference it. --- CHANGES.txt | 4 ++++ coverage/xmlreport.py | 4 ++-- tests/farm/html/gold_x_xml/coverage.xml | 3 +-- tests/farm/html/gold_y_xml_branch/coverage.xml | 3 +-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3b9b9d26..6da614f0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,6 +10,10 @@ Latest instead of a pickle, closing `issue 236`_. The `CoverageData` class is now a public supported API to the data file. +- The XML report now includes a ``missing-branches`` attribute. Thanks, Steve + Peak. This is not a part of the Cobertura DTD, so the XML report no longer + references the DTD. + - All the reporting functions now behave the same if no data had been collected, exiting with a status code of 1. Fixed ``fail_under`` to be applied even when the report is empty. Thanks, Ionel Cristian Mărieș. diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index 0df449f3..aa12ab2d 100644 --- a/coverage/xmlreport.py +++ b/coverage/xmlreport.py @@ -47,8 +47,7 @@ class XmlReporter(Reporter): # Create the DOM that will store the data. impl = xml.dom.minidom.getDOMImplementation() - docType = impl.createDocumentType("coverage", None, DTD_URL) - self.xml_out = impl.createDocument(None, "coverage", docType) + self.xml_out = impl.createDocument(None, "coverage", None) # Write header stuff. xcoverage = self.xml_out.documentElement @@ -57,6 +56,7 @@ class XmlReporter(Reporter): xcoverage.appendChild(self.xml_out.createComment( " Generated by coverage.py: %s " % __url__ )) + xcoverage.appendChild(self.xml_out.createComment(" Based on %s " % DTD_URL)) # Call xml_file for each file in the data. self.report_files(self.xml_file, morfs) diff --git a/tests/farm/html/gold_x_xml/coverage.xml b/tests/farm/html/gold_x_xml/coverage.xml index 9a8fb154..075655dd 100644 --- a/tests/farm/html/gold_x_xml/coverage.xml +++ b/tests/farm/html/gold_x_xml/coverage.xml @@ -1,8 +1,7 @@ - + diff --git a/tests/farm/html/gold_y_xml_branch/coverage.xml b/tests/farm/html/gold_y_xml_branch/coverage.xml index 63625b28..9434ac79 100644 --- a/tests/farm/html/gold_y_xml_branch/coverage.xml +++ b/tests/farm/html/gold_y_xml_branch/coverage.xml @@ -1,8 +1,7 @@ - + -- cgit v1.2.1