src/eric7/Testing/Interfaces/UnittestExecutor.py

branch
eric7
changeset 9547
38fa6ca90253
parent 9473
3f23dbf37dbe
child 9549
67295777d9fe
child 9653
e67609152c5e
--- a/src/eric7/Testing/Interfaces/UnittestExecutor.py	Mon Nov 28 09:06:27 2022 +0100
+++ b/src/eric7/Testing/Interfaces/UnittestExecutor.py	Tue Nov 29 13:37:46 2022 +0100
@@ -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(

eric ide

mercurial