src/eric7/Testing/TestResultsTree.py

branch
eric7
changeset 9500
5771348ded12
parent 9473
3f23dbf37dbe
child 9502
6091145e189e
--- a/src/eric7/Testing/TestResultsTree.py	Wed Nov 09 11:32:13 2022 +0100
+++ b/src/eric7/Testing/TestResultsTree.py	Wed Nov 09 15:05:06 2022 +0100
@@ -146,24 +146,26 @@
                     if duration is None
                     else locale.format_string("%.2f", duration, grouping=True)
                 )
-        elif role == Qt.ItemDataRole.ToolTipRole:
-            if idx == TopLevelId and column == TestResultsModel.NameColumn:
-                return self.__testResults[row].name
-        elif role == Qt.ItemDataRole.FontRole:
-            if idx != TopLevelId:
-                return Preferences.getEditorOtherFonts("MonospacedFont")
-        elif role == Qt.ItemDataRole.BackgroundRole:
-            if idx == TopLevelId:
-                testResult = self.__testResults[row]
-                with contextlib.suppress(KeyError):
-                    return self.__backgroundColors[testResult.category]
-        elif role == Qt.ItemDataRole.TextAlignmentRole:
-            if idx == TopLevelId and column == TestResultsModel.DurationColumn:
-                return Qt.AlignmentFlag.AlignRight.value
-        elif role == Qt.ItemDataRole.UserRole:  # __IGNORE_WARNING_Y102__
-            if idx == TopLevelId:
-                testresult = self.__testResults[row]
-                return (testresult.filename, testresult.lineno)
+        elif (
+            role == Qt.ItemDataRole.ToolTipRole
+            and idx == TopLevelId
+            and column == TestResultsModel.NameColumn
+        ):
+            return self.__testResults[row].name
+        elif role == Qt.ItemDataRole.FontRole and idx != TopLevelId:
+            return Preferences.getEditorOtherFonts("MonospacedFont")
+        elif role == Qt.ItemDataRole.BackgroundRole and idx == TopLevelId:
+            testResult = self.__testResults[row]
+            with contextlib.suppress(KeyError):
+                return self.__backgroundColors[testResult.category]
+        elif (
+            role == Qt.ItemDataRole.TextAlignmentRole
+            and idx == TopLevelId and column == TestResultsModel.DurationColumn
+        ):
+            return Qt.AlignmentFlag.AlignRight.value
+        elif role == Qt.ItemDataRole.UserRole and idx == TopLevelId:
+            testresult = self.__testResults[row]
+            return (testresult.filename, testresult.lineno)
 
         return None
 

eric ide

mercurial