2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Fix pytest junitxml output processing for make check

Not every element tagged `skipped` in the JUnitXML tree has to contain
the `type` attribute. An example of that is a test that results in
xpass.

This has been verified with pytest version 7.4.2 and prior.
This commit is contained in:
Tom Krizek 2023-10-30 16:16:33 +01:00
parent 1a724685a0
commit ba25ecd2d2
No known key found for this signature in database
GPG Key ID: 01623B9B652A20A7

View File

@ -34,7 +34,7 @@ def junit_to_trs(junit_xml):
res = "ERROR" res = "ERROR"
has_error = True has_error = True
elif node.tag == "skipped": elif node.tag == "skipped":
if node.attrib["type"] == "pytest.xfail": if node.attrib.get("type") == "pytest.xfail":
res = "XFAIL" res = "XFAIL"
else: else:
res = "SKIP" res = "SKIP"