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ć
|
Jurko Gospodnetić
|
||||||
Justice Ndou
|
Justice Ndou
|
||||||
Justyna Janczyszyn
|
Justyna Janczyszyn
|
||||||
|
Kai Kasprowsky
|
||||||
Kale Kundert
|
Kale Kundert
|
||||||
Kamran Ahmad
|
Kamran Ahmad
|
||||||
Karl O. Pinc
|
Karl O. Pinc
|
||||||
|
|
|
@ -186,6 +186,15 @@ class _NodeReporter:
|
||||||
return "\n".join([header.center(80, "-"), content, ""])
|
return "\n".join([header.center(80, "-"), content, ""])
|
||||||
|
|
||||||
def _write_content(self, report: TestReport, content: str, jheader: str) -> None:
|
def _write_content(self, report: TestReport, content: str, jheader: str) -> None:
|
||||||
|
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 = ET.Element(jheader)
|
||||||
tag.text = bin_xml_escape(content)
|
tag.text = bin_xml_escape(content)
|
||||||
self.append(tag)
|
self.append(tag)
|
||||||
|
|
Loading…
Reference in New Issue