summaryrefslogtreecommitdiff
path: root/tests/test_xml.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2020-06-30 08:03:45 -0400
committerNed Batchelder <ned@nedbatchelder.com>2020-06-30 08:03:45 -0400
commit97f05c988545f8ca588253fd325401c4834543b6 (patch)
tree41b223ce1a1bf1f33aaad9ffd41351156ad92da6 /tests/test_xml.py
parentd00f254315ef4e97e86e230c448d6325c97e08dc (diff)
downloadpython-coveragepy-git-nedbat/bug976.tar.gz
--skip-empty now applies to the XML report also. #976nedbat/bug976
Diffstat (limited to 'tests/test_xml.py')
-rw-r--r--tests/test_xml.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_xml.py b/tests/test_xml.py
index 0d789fca..8c399594 100644
--- a/tests/test_xml.py
+++ b/tests/test_xml.py
@@ -185,6 +185,13 @@ class XmlReportTest(XmlTestHelpers, CoverageTest):
assert len(elts) == 1
assert elts[0].get('line-rate') == '1'
+ def test_empty_file_is_skipped(self):
+ cov = self.run_doit()
+ cov.xml_report(skip_empty=True)
+ dom = ElementTree.parse("coverage.xml")
+ elts = dom.findall(".//class[@name='__init__.py']")
+ assert len(elts) == 0
+
def test_curdir_source(self):
# With no source= option, the XML report should explain that the source
# is in the current directory.