From 06b220291a51f3fb1b36073c270b78ed92791071 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Mon, 4 Dec 2023 22:46:51 +0100 Subject: [PATCH] retrieve the message from the `reprcrash` object (#28) As the traceback chain proves to be unreliable? --- parse_logs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse_logs.py b/parse_logs.py index c7ceff7..08cb1af 100644 --- a/parse_logs.py +++ b/parse_logs.py @@ -89,7 +89,7 @@ def _(report: TestReport): if isinstance(report.longrepr, str): message = report.longrepr else: - message = report.longrepr.chain[0][1].message + message = report.longrepr.reprcrash.message return PreformattedReport(message=message, **parsed) @@ -110,7 +110,7 @@ def _(report: CollectReport): if isinstance(report.longrepr, str): message = report.longrepr.split("\n")[-1].removeprefix("E").lstrip() else: - message = report.longrepr.chain[0][1].message + message = report.longrepr.reprcrash.message return PreformattedReport(message=message, **parsed)