eric6/PyUnit/UnittestDialog.py

branch
maintenance
changeset 8043
0acf98cd089a
parent 7924
8a96736d465e
parent 8029
5feb4f723f07
child 8176
31965986ecd1
diff -r 866adc8c315b -r 0acf98cd089a eric6/PyUnit/UnittestDialog.py
--- a/eric6/PyUnit/UnittestDialog.py	Sun Jan 17 13:53:08 2021 +0100
+++ b/eric6/PyUnit/UnittestDialog.py	Mon Feb 01 10:38:16 2021 +0100
@@ -48,6 +48,13 @@
     
     ErrorsInfoRole = Qt.UserRole
     
+    SkippedColorDarkTheme = QColor("#00aaff")
+    FailedExpectedColorDarkTheme = QColor("#ccaaff")
+    SucceededUnexpectedColorDarkTheme = QColor("#ff99dd")
+    SkippedColorLightTheme = QColor("#0000ff")
+    FailedExpectedColorLightTheme = QColor("#7700bb")
+    SucceededUnexpectedColorLightTheme = QColor("#ff0000")
+    
     def __init__(self, prog=None, dbs=None, ui=None, parent=None, name=None):
         """
         Constructor
@@ -55,7 +62,7 @@
         @param prog filename of the program to open
         @type str
         @param dbs reference to the debug server object. It is an indication
-            whether we were called from within the eric6 IDE.
+            whether we were called from within the eric IDE.
         @type DebugServer
         @param ui reference to the UI object
         @type UserInterface
@@ -165,7 +172,7 @@
         
         self.__failedTests = []
         
-        # now connect the debug server signals if called from the eric6 IDE
+        # now connect the debug server signals if called from the eric IDE
         if self.__dbs:
             self.__dbs.utDiscovered.connect(self.__UTDiscovered)
             self.__dbs.utPrepared.connect(self.__UTPrepared)
@@ -379,7 +386,7 @@
         if self.__dbs:
             venvName = self.venvComboBox.currentText()
             
-            # we are cooperating with the eric6 IDE
+            # we are cooperating with the eric IDE
             project = e5App().getObject("Project")
             if self.__forProject:
                 mainScript = project.getMainScript(True)
@@ -660,7 +667,7 @@
         """
         Public slot to start the test.
         
-        @keyparam failedOnly flag indicating to run only failed tests (boolean)
+        @param failedOnly flag indicating to run only failed tests (boolean)
         """
         if self.running:
             return
@@ -721,7 +728,7 @@
         if self.__dbs:
             venvName = self.venvComboBox.currentText()
             
-            # we are cooperating with the eric6 IDE
+            # we are cooperating with the eric IDE
             project = e5App().getObject("Project")
             if self.__forProject:
                 mainScript = project.getMainScript(True)
@@ -1050,12 +1057,15 @@
         self.skippedCount += 1
         self.progressCounterSkippedCount.setText(str(self.skippedCount))
         itm = QListWidgetItem(self.tr("    Skipped: {0}").format(reason))
-        itm.setForeground(Qt.blue)
+        if e5App().usesDarkPalette():
+            itm.setForeground(self.SkippedColorDarkTheme)
+        else:
+            itm.setForeground(self.SkippedColorLightTheme)
         self.testsListWidget.insertItem(1, itm)
     
     def testFailedExpected(self, test, exc, testId):
         """
-        Public method called if a test fails expectedly.
+        Public method called if a test fails as expected.
         
         @param test name of the test (string)
         @param exc string representation of the exception (string)
@@ -1065,7 +1075,10 @@
         self.progressCounterExpectedFailureCount.setText(
             str(self.expectedFailureCount))
         itm = QListWidgetItem(self.tr("    Expected Failure"))
-        itm.setForeground(Qt.blue)
+        if e5App().usesDarkPalette():
+            itm.setForeground(self.FailedExpectedColorDarkTheme)
+        else:
+            itm.setForeground(self.FailedExpectedColorLightTheme)
         self.testsListWidget.insertItem(1, itm)
     
     def testSucceededUnexpected(self, test, testId):
@@ -1079,7 +1092,10 @@
         self.progressCounterUnexpectedSuccessCount.setText(
             str(self.unexpectedSuccessCount))
         itm = QListWidgetItem(self.tr("    Unexpected Success"))
-        itm.setForeground(Qt.red)
+        if e5App().usesDarkPalette():
+            itm.setForeground(self.SucceededUnexpectedColorDarkTheme)
+        else:
+            itm.setForeground(self.SucceededUnexpectedColorLightTheme)
         self.testsListWidget.insertItem(1, itm)
     
     def testStarted(self, test, doc):
@@ -1155,7 +1171,7 @@
     
     def __showSource(self):
         """
-        Private slot to show the source of a traceback in an eric6 editor.
+        Private slot to show the source of a traceback in an eric editor.
         """
         # get the error info
         tracebackLines = self.dlg.traceback.toPlainText().splitlines()

eric ide

mercurial