PyUnit/UnittestDialog.py

changeset 428
58405c24aa09
parent 55
b5c84934de9c
child 464
a2b1d1770ef0
equal deleted inserted replaced
427:6af5d12cfecb 428:58405c24aa09
151 """ 151 """
152 Private slot to open a file dialog. 152 Private slot to open a file dialog.
153 """ 153 """
154 if self.dbs: 154 if self.dbs:
155 pyExtensions = \ 155 pyExtensions = \
156 ' '.join(["*%s" % ext for ext in self.dbs.getExtensions('Python')]) 156 ' '.join(["*{0}".format(ext) for ext in self.dbs.getExtensions('Python')])
157 py3Extensions = \ 157 py3Extensions = \
158 ' '.join(["*%s" % ext for ext in self.dbs.getExtensions('Python3')]) 158 ' '.join(["*{0}".format(ext) for ext in self.dbs.getExtensions('Python3')])
159 filter = self.trUtf8("Python3 Files ({1});;Python2 Files ({0});;All Files (*)")\ 159 filter = self.trUtf8("Python3 Files ({1});;Python2 Files ({0});;All Files (*)")\
160 .format(pyExtensions, py3Extensions) 160 .format(pyExtensions, py3Extensions)
161 else: 161 else:
162 filter = self.trUtf8("Python Files (*.py);;All Files (*)") 162 filter = self.trUtf8("Python Files (*.py);;All Files (*)")
163 prog = QFileDialog.getOpenFileName(\ 163 prog = QFileDialog.getOpenFileName(\
274 else: 274 else:
275 mainScript = os.path.abspath(prog) 275 mainScript = os.path.abspath(prog)
276 else: 276 else:
277 mainScript = os.path.abspath(prog) 277 mainScript = os.path.abspath(prog)
278 cover = coverage( 278 cover = coverage(
279 data_file = "%s.coverage" % os.path.splitext(mainScript)[0]) 279 data_file = "{0}.coverage".format(os.path.splitext(mainScript)[0]))
280 cover.use_cache(True) 280 cover.use_cache(True)
281 if self.coverageEraseCheckBox.isChecked(): 281 if self.coverageEraseCheckBox.isChecked():
282 cover.erase() 282 cover.erase()
283 else: 283 else:
284 cover = None 284 cover = None
421 421
422 @param test name of the started test (string) 422 @param test name of the started test (string)
423 @param doc documentation of the started test (string) 423 @param doc documentation of the started test (string)
424 """ 424 """
425 if doc: 425 if doc:
426 self.testsListWidget.insertItem(0, " %s" % doc) 426 self.testsListWidget.insertItem(0, " {0}".format(doc))
427 self.testsListWidget.insertItem(0, test) 427 self.testsListWidget.insertItem(0, test)
428 if self.dbs is None or self.localCheckBox.isChecked(): 428 if self.dbs is None or self.localCheckBox.isChecked():
429 QApplication.processEvents() 429 QApplication.processEvents()
430 430
431 def testFinished(self): 431 def testFinished(self):

eric ide

mercurial