576 @type QTreeWidgetItem |
576 @type QTreeWidgetItem |
577 @return list of selected test cases |
577 @return list of selected test cases |
578 @rtype list of str |
578 @rtype list of str |
579 """ |
579 """ |
580 selectedTests = [] |
580 selectedTests = [] |
581 if parent is None: |
581 itemsList = [ |
582 # top level |
582 # top level |
583 itemsList = [ |
583 self.discoveryList.topLevelItem(index) |
584 self.discoveryList.topLevelItem(index) |
584 for index in range(self.discoveryList.topLevelItemCount()) |
585 for index in range(self.discoveryList.topLevelItemCount()) |
585 ] if parent is None else [ |
586 ] |
586 parent.child(index) |
587 else: |
587 for index in range(parent.childCount()) |
588 itemsList = [ |
588 ] |
589 parent.child(index) |
|
590 for index in range(parent.childCount()) |
|
591 ] |
|
592 |
589 |
593 for itm in itemsList: |
590 for itm in itemsList: |
594 if (itm.checkState(0) == Qt.CheckState.Checked and |
591 if ( |
|
592 itm.checkState(0) == Qt.CheckState.Checked and |
595 itm.childCount() == 0 |
593 itm.childCount() == 0 |
596 ): |
594 ): |
597 selectedTests.append( |
595 selectedTests.append( |
598 itm.data(0, UnittestDialog.TestCaseNameRole)) |
596 itm.data(0, UnittestDialog.TestCaseNameRole)) |
599 if itm.childCount(): |
597 if itm.childCount(): |