eric7/PyUnit/UnittestDialog.py

branch
eric7
changeset 8366
2a9f5153c438
parent 8358
144a6b854f70
child 8444
88b242eba71b
equal deleted inserted replaced
8365:cde9bde830ea 8366:2a9f5153c438
577 @type QTreeWidgetItem 577 @type QTreeWidgetItem
578 @return list of selected test cases 578 @return list of selected test cases
579 @rtype list of str 579 @rtype list of str
580 """ 580 """
581 selectedTests = [] 581 selectedTests = []
582 if parent is None: 582 itemsList = [
583 # top level 583 self.discoveryList.topLevelItem(index)
584 itemsList = [ 584 for index in range(self.discoveryList.topLevelItemCount())
585 self.discoveryList.topLevelItem(index) 585 ] if parent is None else [
586 for index in range(self.discoveryList.topLevelItemCount()) 586 parent.child(index)
587 ] 587 for index in range(parent.childCount())
588 else: 588 ]
589 itemsList = [
590 parent.child(index)
591 for index in range(parent.childCount())
592 ]
593 589
594 for itm in itemsList: 590 for itm in itemsList:
595 if (itm.checkState(0) == Qt.CheckState.Checked and 591 if (
592 itm.checkState(0) == Qt.CheckState.Checked and
596 itm.childCount() == 0 593 itm.childCount() == 0
597 ): 594 ):
598 selectedTests.append( 595 selectedTests.append(
599 itm.data(0, UnittestDialog.TestCaseNameRole)) 596 itm.data(0, UnittestDialog.TestCaseNameRole))
600 if itm.childCount(): 597 if itm.childCount():

eric ide

mercurial