diff -r 24c847222774 -r 67295777d9fe src/eric7/Testing/Interfaces/UnittestExecutor.py --- a/src/eric7/Testing/Interfaces/UnittestExecutor.py Mon Oct 31 14:07:57 2022 +0100 +++ b/src/eric7/Testing/Interfaces/UnittestExecutor.py Wed Nov 30 09:19:51 2022 +0100 @@ -12,7 +12,7 @@ import os import re -from PyQt6.QtCore import pyqtSlot, QProcess +from PyQt6.QtCore import QProcess, pyqtSlot from eric7.EricNetwork.EricJsonStreamReader import EricJsonReader @@ -222,7 +222,12 @@ message = data.get("shortmsg", "") if not message and tracebackLines: - message = tracebackLines[-1].split(":", 1)[1].strip() + # search the line containing the assertion error + for index in range(len(tracebackLines) - 1, -1, -1): + line = tracebackLines[index].strip() + if line.startswith("AssertionError:"): + message = line.replace("AssertionError:", "").strip() + break self.testResult.emit( TestResult(