diff --git a/sphinxcontrib/test_reports/junitparser.py b/sphinxcontrib/test_reports/junitparser.py index 7430f6a..2992197 100644 --- a/sphinxcontrib/test_reports/junitparser.py +++ b/sphinxcontrib/test_reports/junitparser.py @@ -72,6 +72,12 @@ def parse_testcase(xml_object): # tc_dict["text"] = re.sub(r"[\n\t]*", "", result.text) # Removes newlines and tabs tc_dict["text"] = result.text tc_dict["message"] = "" + elif hasattr(testcase, "error"): + result = testcase.error + tc_dict["result"] = "error" + tc_dict["type"] = result.attrib.get("type", "unknown") + tc_dict["text"] = result.text or "" + tc_dict["message"] = "" else: tc_dict["result"] = "passed" tc_dict["type"] = ""