diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-23 14:25:17 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-23 14:25:17 -0500 |
commit | d1ae46f93594f91cba299644c25852a3230d6e26 (patch) | |
tree | bd73def0802fa0ba388abe8be6a9a1dafcc8ed13 /tests/test_xml.py | |
parent | 95c9930f5c936571f32b873c6a9110204a2404ec (diff) | |
download | python-coveragepy-d1ae46f93594f91cba299644c25852a3230d6e26.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.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_xml.py b/tests/test_xml.py index 60cdd71..357c4ea 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`.""" |