From 43085b9d5378ef343ac214fd15e8f7c2ceffa95f Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 27 Apr 2023 07:12:30 -0400 Subject: refactor: parametrize a test for #1608 --- coverage/xmlreport.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'coverage/xmlreport.py') diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py index b2180266..82e60fc1 100644 --- a/coverage/xmlreport.py +++ b/coverage/xmlreport.py @@ -67,10 +67,10 @@ class XmlReporter: if self.config.source: for src in self.config.source: if os.path.exists(src): - if not self.config.relative_files: - src = files.canonical_filename(src) - else: + if self.config.relative_files: src = src.rstrip(r"\/") + else: + src = files.canonical_filename(src) self.source_paths.add(src) self.packages: Dict[str, PackageData] = {} self.xml_out: xml.dom.minidom.Document -- cgit v1.2.1