eric7/PyUnit/UnittestDialog.py

branch
eric7
changeset 8366
2a9f5153c438
parent 8358
144a6b854f70
child 8444
88b242eba71b
diff -r cde9bde830ea -r 2a9f5153c438 eric7/PyUnit/UnittestDialog.py
--- a/eric7/PyUnit/UnittestDialog.py	Sun May 23 13:33:13 2021 +0200
+++ b/eric7/PyUnit/UnittestDialog.py	Sun May 23 15:35:49 2021 +0200
@@ -579,20 +579,17 @@
         @rtype list of str
         """
         selectedTests = []
-        if parent is None:
-            # top level
-            itemsList = [
-                self.discoveryList.topLevelItem(index)
-                for index in range(self.discoveryList.topLevelItemCount())
-            ]
-        else:
-            itemsList = [
-                parent.child(index)
-                for index in range(parent.childCount())
-            ]
+        itemsList = [
+            self.discoveryList.topLevelItem(index)
+            for index in range(self.discoveryList.topLevelItemCount())
+        ] if parent is None else [
+            parent.child(index)
+            for index in range(parent.childCount())
+        ]
         
         for itm in itemsList:
-            if (itm.checkState(0) == Qt.CheckState.Checked and
+            if (
+                itm.checkState(0) == Qt.CheckState.Checked and
                 itm.childCount() == 0
             ):
                 selectedTests.append(

eric ide

mercurial