summaryrefslogtreecommitdiff
path: root/coverage/xmlreport.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-11-07 10:36:23 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-11-07 10:36:23 -0500
commit965a10aaa2287ac678f0a821004ee8ceae005957 (patch)
treec036d20955b28045a3d31e8c3c2a30a3f66c3492 /coverage/xmlreport.py
parente0ccb31492029204c8b2bb9e186fe8303df81d2e (diff)
downloadpython-coveragepy-965a10aaa2287ac678f0a821004ee8ceae005957.tar.gz
Use the patch from <<issue 23>> to get Cobertura to find source files.
Diffstat (limited to 'coverage/xmlreport.py')
-rw-r--r--coverage/xmlreport.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py
index 155f7bf..0fe4371 100644
--- a/coverage/xmlreport.py
+++ b/coverage/xmlreport.py
@@ -97,7 +97,8 @@ class XmlReporter(Reporter):
xclass.appendChild(xlines)
className = fname.replace('.', '_')
xclass.setAttribute("name", className)
- xclass.setAttribute("filename", os.path.split(cu.filename)[1])
+ ext = os.path.splitext(cu.filename)[1]
+ xclass.setAttribute("filename", cu.name + ext)
xclass.setAttribute("complexity", "0.0")
# For each statement, create an XML 'line' element.