PyUnit/UnittestDialog.py

changeset 3670
f0cb7579c0b4
parent 3656
441956d8fce5
child 4021
195a471c327b
equal deleted inserted replaced
3669:ac84ac3c0f05 3670:f0cb7579c0b4
49 """ 49 """
50 Constructor 50 Constructor
51 51
52 @param prog filename of the program to open 52 @param prog filename of the program to open
53 @param dbs reference to the debug server object. It is an indication 53 @param dbs reference to the debug server object. It is an indication
54 whether we were called from within the eric5 IDE 54 whether we were called from within the eric6 IDE
55 @param ui reference to the UI object 55 @param ui reference to the UI object
56 @param fromEric flag indicating an instantiation from within the 56 @param fromEric flag indicating an instantiation from within the
57 eric IDE (boolean) 57 eric IDE (boolean)
58 @param parent parent widget of this dialog (QWidget) 58 @param parent parent widget of this dialog (QWidget)
59 @param name name of this dialog (string) 59 @param name name of this dialog (string)
121 self.tr("^Error: "), 121 self.tr("^Error: "),
122 ] 122 ]
123 123
124 self.__failedTests = [] 124 self.__failedTests = []
125 125
126 # now connect the debug server signals if called from the eric5 IDE 126 # now connect the debug server signals if called from the eric6 IDE
127 if self.dbs: 127 if self.dbs:
128 self.dbs.utPrepared.connect(self.__UTPrepared) 128 self.dbs.utPrepared.connect(self.__UTPrepared)
129 self.dbs.utFinished.connect(self.__setStoppedMode) 129 self.dbs.utFinished.connect(self.__setStoppedMode)
130 self.dbs.utStartTest.connect(self.testStarted) 130 self.dbs.utStartTest.connect(self.testStarted)
131 self.dbs.utStopTest.connect(self.testFinished) 131 self.dbs.utStopTest.connect(self.testFinished)
278 278
279 # build the module name from the filename without extension 279 # build the module name from the filename without extension
280 self.testName = os.path.splitext(os.path.basename(prog))[0] 280 self.testName = os.path.splitext(os.path.basename(prog))[0]
281 281
282 if self.dbs and not self.localCheckBox.isChecked(): 282 if self.dbs and not self.localCheckBox.isChecked():
283 # we are cooperating with the eric5 IDE 283 # we are cooperating with the eric6 IDE
284 project = e5App().getObject("Project") 284 project = e5App().getObject("Project")
285 if project.isOpen() and project.isProjectSource(prog): 285 if project.isOpen() and project.isProjectSource(prog):
286 mainScript = project.getMainScript(True) 286 mainScript = project.getMainScript(True)
287 clientType = project.getProjectLanguage() 287 clientType = project.getProjectLanguage()
288 else: 288 else:
345 return 345 return
346 346
347 # now set up the coverage stuff 347 # now set up the coverage stuff
348 if self.coverageCheckBox.isChecked(): 348 if self.coverageCheckBox.isChecked():
349 if self.dbs: 349 if self.dbs:
350 # we are cooperating with the eric5 IDE 350 # we are cooperating with the eric6 IDE
351 project = e5App().getObject("Project") 351 project = e5App().getObject("Project")
352 if project.isOpen() and project.isProjectSource(prog): 352 if project.isOpen() and project.isProjectSource(prog):
353 mainScript = project.getMainScript(True) 353 mainScript = project.getMainScript(True)
354 if not mainScript: 354 if not mainScript:
355 mainScript = os.path.abspath(prog) 355 mainScript = os.path.abspath(prog)
645 self.dlg.show() 645 self.dlg.show()
646 self.dlg.exec_() 646 self.dlg.exec_()
647 647
648 def __showSource(self): 648 def __showSource(self):
649 """ 649 """
650 Private slot to show the source of a traceback in an eric5 editor. 650 Private slot to show the source of a traceback in an eric6 editor.
651 """ 651 """
652 if not self.dbs: 652 if not self.dbs:
653 return 653 return
654 654
655 # get the error info 655 # get the error info

eric ide

mercurial