252 if self.running: |
252 if self.running: |
253 return |
253 return |
254 |
254 |
255 prog = self.testsuiteComboBox.currentText() |
255 prog = self.testsuiteComboBox.currentText() |
256 if not prog: |
256 if not prog: |
257 E5MessageBox.critical(self, |
257 E5MessageBox.critical( |
258 self.trUtf8("Unittest"), |
258 self, |
259 self.trUtf8("You must enter a test suite file.")) |
259 self.trUtf8("Unittest"), |
|
260 self.trUtf8("You must enter a test suite file.")) |
260 return |
261 return |
261 |
262 |
262 # prepend the selected file to the testsuite combobox |
263 # prepend the selected file to the testsuite combobox |
263 self.insertProg(prog) |
264 self.insertProg(prog) |
264 self.sbLabel.setText(self.trUtf8("Preparing Testsuite")) |
265 self.sbLabel.setText(self.trUtf8("Preparing Testsuite")) |
326 except AttributeError: |
327 except AttributeError: |
327 test = unittest.defaultTestLoader.loadTestsFromModule( |
328 test = unittest.defaultTestLoader.loadTestsFromModule( |
328 module) |
329 module) |
329 except: |
330 except: |
330 exc_type, exc_value, exc_tb = sys.exc_info() |
331 exc_type, exc_value, exc_tb = sys.exc_info() |
331 E5MessageBox.critical(self, |
332 E5MessageBox.critical( |
332 self.trUtf8("Unittest"), |
333 self, |
333 self.trUtf8( |
334 self.trUtf8("Unittest"), |
334 "<p>Unable to run test <b>{0}</b>.<br>" |
335 self.trUtf8( |
335 "{1}<br>{2}</p>") |
336 "<p>Unable to run test <b>{0}</b>.<br>" |
336 .format(self.testName, str(exc_type), |
337 "{1}<br>{2}</p>") |
337 str(exc_value))) |
338 .format(self.testName, str(exc_type), |
|
339 str(exc_value))) |
338 return |
340 return |
339 |
341 |
340 # now set up the coverage stuff |
342 # now set up the coverage stuff |
341 if self.coverageCheckBox.isChecked(): |
343 if self.coverageCheckBox.isChecked(): |
342 if self.dbs: |
344 if self.dbs: |
384 @param nrTests number of tests contained in the test suite (integer) |
386 @param nrTests number of tests contained in the test suite (integer) |
385 @param exc_type type of exception occured during preparation (string) |
387 @param exc_type type of exception occured during preparation (string) |
386 @param exc_value value of exception occured during preparation (string) |
388 @param exc_value value of exception occured during preparation (string) |
387 """ |
389 """ |
388 if nrTests == 0: |
390 if nrTests == 0: |
389 E5MessageBox.critical(self, |
391 E5MessageBox.critical( |
390 self.trUtf8("Unittest"), |
392 self, |
391 self.trUtf8( |
393 self.trUtf8("Unittest"), |
392 "<p>Unable to run test <b>{0}</b>.<br>{1}<br>{2}</p>") |
394 self.trUtf8( |
393 .format(self.testName, exc_type, exc_value)) |
395 "<p>Unable to run test <b>{0}</b>.<br>{1}<br>{2}</p>") |
|
396 .format(self.testName, exc_type, exc_value)) |
394 return |
397 return |
395 |
398 |
396 self.totalTests = nrTests |
399 self.totalTests = nrTests |
397 self.__setRunningMode() |
400 self.__setRunningMode() |
398 self.dbs.remoteUTRun() |
401 self.dbs.remoteUTRun() |