summaryrefslogtreecommitdiff
path: root/tests/test_xml.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-01-23 14:25:17 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-01-23 14:25:17 -0500
commit851cad1819958893ac44208510e8d3ab86c0d77d (patch)
tree4048a9638e65e7de853ba7f3ca00a9ddce88bbf0 /tests/test_xml.py
parentf9f70709ef14812aea64cb450c67f99bac6ef6ac (diff)
downloadpython-coveragepy-git-851cad1819958893ac44208510e8d3ab86c0d77d.tar.gz
Do a better job with sources in the XML report
Diffstat (limited to 'tests/test_xml.py')
-rw-r--r--tests/test_xml.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_xml.py b/tests/test_xml.py
index 60cdd71d..357c4ead 100644
--- a/tests/test_xml.py
+++ b/tests/test_xml.py
@@ -271,6 +271,16 @@ class XmlPackageStructureTest(XmlTestHelpers, CoverageTest):
<class filename="d0/d0/d0/f0.py" name="f0.py">
""")
+ def test_source_prefix(self):
+ # https://bitbucket.org/ned/coveragepy/issues/465
+ self.make_file("src/mod.py", "print(17)")
+ cov = coverage.Coverage(source=["src"])
+ self.start_import_stop(cov, "mod", modfile="src/mod.py")
+ self.assert_package_and_class_tags(cov, """\
+ <package name=".">
+ <class filename="src/mod.py" name="mod.py">
+ """)
+
def re_lines(text, pat):
"""Return a list of lines that match `pat` in the string `text`."""