summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-22 09:12:21 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-22 09:12:21 -0400
commitd44f4e1fd27926eeaeb49dd06f263de96c7ae2df (patch)
tree0d0f99187cdda4b3575173b063cfc7bddd642d6a
parent3d46673ad7461d5b90b12b3de62d84611e293fa9 (diff)
downloadpython-coveragepy-d44f4e1fd27926eeaeb49dd06f263de96c7ae2df.tar.gz
The DTD is no longer valid. Don't reference it.
-rw-r--r--CHANGES.txt4
-rw-r--r--coverage/xmlreport.py4
-rw-r--r--tests/farm/html/gold_x_xml/coverage.xml3
-rw-r--r--tests/farm/html/gold_y_xml_branch/coverage.xml3
4 files changed, 8 insertions, 6 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 3b9b9d2..6da614f 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 0df449f..aa12ab2 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 9a8fb15..075655d 100644
--- a/tests/farm/html/gold_x_xml/coverage.xml
+++ b/tests/farm/html/gold_x_xml/coverage.xml
@@ -1,8 +1,7 @@
<?xml version="1.0" ?>
-<!DOCTYPE coverage
- SYSTEM 'https://raw.githubusercontent.com/cobertura/web/f0366e5e2cf18f111cbd61fc34ef720a6584ba02/htdocs/xml/coverage-03.dtd'>
<coverage branch-rate="0" line-rate="0.6667" timestamp="1253972570431" version="3.1b1">
<!-- Generated by coverage.py: https://coverage.readthedocs.org/VER -->
+ <!-- Based on https://raw.githubusercontent.com/cobertura/web/f0366e5e2cf18f111cbd61fc34ef720a6584ba02/htdocs/xml/coverage-03.dtd -->
<sources>
<source></source>
</sources>
diff --git a/tests/farm/html/gold_y_xml_branch/coverage.xml b/tests/farm/html/gold_y_xml_branch/coverage.xml
index 63625b2..9434ac7 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 @@
<?xml version="1.0" ?>
-<!DOCTYPE coverage
- SYSTEM 'https://raw.githubusercontent.com/cobertura/web/f0366e5e2cf18f111cbd61fc34ef720a6584ba02/htdocs/xml/coverage-03.dtd'>
<coverage branch-rate="0.5" line-rate="0.8" timestamp="1259288252325" version="3.2b4">
<!-- Generated by coverage.py: https://coverage.readthedocs.org/VER -->
+ <!-- Based on https://raw.githubusercontent.com/cobertura/web/f0366e5e2cf18f111cbd61fc34ef720a6584ba02/htdocs/xml/coverage-03.dtd -->
<sources>
<source></source>
</sources>