Fix double <system-out> entry in junit.xml
check it system-out already exists if this is the case append text
This commit is contained in:
parent
2369bed1db
commit
ca782ca4f3
|
@ -0,0 +1 @@
|
|||
only create <system-out> in junit.xml once for each test.
|
1
AUTHORS
1
AUTHORS
|
@ -189,6 +189,7 @@ Joshua Bronson
|
|||
Jurko Gospodnetić
|
||||
Justice Ndou
|
||||
Justyna Janczyszyn
|
||||
Kai Kasprowsky
|
||||
Kale Kundert
|
||||
Kamran Ahmad
|
||||
Karl O. Pinc
|
||||
|
|
|
@ -186,9 +186,18 @@ class _NodeReporter:
|
|||
return "\n".join([header.center(80, "-"), content, ""])
|
||||
|
||||
def _write_content(self, report: TestReport, content: str, jheader: str) -> None:
|
||||
tag = ET.Element(jheader)
|
||||
tag.text = bin_xml_escape(content)
|
||||
self.append(tag)
|
||||
exists = False
|
||||
for elem in next(iter(self.xml.node_reporters.values())).nodes:
|
||||
if jheader in elem.tag:
|
||||
exists = True
|
||||
tag = elem
|
||||
tag.text = (
|
||||
tag.text + bin_xml_escape(content) if tag.text is not None else None
|
||||
)
|
||||
if not exists:
|
||||
tag = ET.Element(jheader)
|
||||
tag.text = bin_xml_escape(content)
|
||||
self.append(tag)
|
||||
|
||||
def append_pass(self, report: TestReport) -> None:
|
||||
self.add_stats("passed")
|
||||
|
|
Loading…
Reference in New Issue