summaryrefslogtreecommitdiff
path: root/coverage/xmlreport.py
diff options
context:
space:
mode:
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 155f7bf5..0fe43712 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.