5371 @type str |
5371 @type str |
5372 """ |
5372 """ |
5373 if testFile is None: |
5373 if testFile is None: |
5374 aw = self.viewmanager.activeWindow() |
5374 aw = self.viewmanager.activeWindow() |
5375 fn = aw.getFileName() |
5375 fn = aw.getFileName() |
5376 tfn = Utilities.getTestFileName(fn) |
5376 testFile = [ |
5377 if os.path.exists(tfn): |
5377 f for f in Utilities.getTestFileNames(fn) + [fn] |
5378 testFile = tfn |
5378 if os.path.exists(f) |
5379 else: |
5379 ][0] |
5380 testFile = fn |
|
5381 |
5380 |
5382 self.__startTesting() |
5381 self.__startTesting() |
5383 self.__testingWidget.setTestFile(testFile) |
5382 self.__testingWidget.setTestFile(testFile, forProject=False) |
5384 self.restartTestAct.setEnabled(False) |
5383 self.restartTestAct.setEnabled(False) |
5385 self.rerunFailedTestsAct.setEnabled(False) |
5384 self.rerunFailedTestsAct.setEnabled(False) |
5386 |
5385 |
5387 @pyqtSlot() |
5386 @pyqtSlot() |
5388 def __startTestProject(self): |
5387 def __startTestProject(self): |
5391 the current project. |
5390 the current project. |
5392 """ |
5391 """ |
5393 testFile = None |
5392 testFile = None |
5394 fn = self.project.getMainScript(True) |
5393 fn = self.project.getMainScript(True) |
5395 if fn: |
5394 if fn: |
5396 tfn = Utilities.getTestFileName(fn) |
5395 testFile = [ |
5397 if os.path.exists(tfn): |
5396 f for f in Utilities.getTestFileNames(fn) + [fn] |
5398 testFile = tfn |
5397 if os.path.exists(f) |
|
5398 ][0] |
5399 |
5399 |
5400 self.__startTesting() |
5400 self.__startTesting() |
5401 self.__testingWidget.setTestFile(testFile) |
5401 self.__testingWidget.setTestFile(testFile, forProject=True) |
5402 self.restartTestAct.setEnabled(False) |
5402 self.restartTestAct.setEnabled(False) |
5403 self.rerunFailedTestsAct.setEnabled(False) |
5403 self.rerunFailedTestsAct.setEnabled(False) |
5404 |
5404 |
5405 def __restartTest(self): |
5405 def __restartTest(self): |
5406 """ |
5406 """ |