--- a/eric7/Unittest/Interfaces/UTExecutorBase.py Thu May 12 09:00:35 2022 +0200 +++ b/eric7/Unittest/Interfaces/UTExecutorBase.py Fri May 13 17:23:21 2022 +0200 @@ -21,6 +21,7 @@ """ Class defining the supported result categories. """ + RUNNING = 0 FAIL = 1 OK = 2 SKIP = 3 @@ -32,14 +33,16 @@ """ Class containing the test result data. """ - category: int # result category + category: ResultCategory # result category status: str # test status name: str # test name - message: str # short result message - extra: str # additional information text - duration: float # test duration - filename: str # file name of a failed test - lineno: int # line number of a failed test + id: str # test id + description: str = "" # short description of test + message: str = "" # short result message + extra: list = None # additional information text + duration: float = None # test duration + filename: str = None # file name of a failed test + lineno: int = None # line number of a failed test @dataclass @@ -61,43 +64,47 @@ """ Base class for test framework specific implementations. - @signal collected(list of str) emitted after all tests have been - collected + @signal collected(list of tuple of (str, str, str)) emitted after all tests + have been collected. Tuple elements are the test id, the test name and + a short description of the test. @signal collectError(list of tuple of (str, str)) emitted when errors are encountered during test collection. Tuple elements are the test name and the error message. - @signal startTest(list of str) emitted before tests are run + @signal startTest(tuple of (str, str, str) emitted before tests are run. + Tuple elements are test id, test name and short description. @signal testResult(UTTestResult) emitted when a test result is ready @signal testFinished(list, str) emitted when the test has finished. The elements are the list of test results and the captured output of the test worker (if any). + @signal testRunFinished(int, float) emitted when the test run has finished. + The elements are the number of tests run and the duration in seconds @signal stop() emitted when the test process is being stopped. + @signal coverageDataSaved(str) emitted after the coverage data was saved. + The element is the absolute path of the coverage data file. """ collected = pyqtSignal(list) collectError = pyqtSignal(list) - startTest = pyqtSignal(list) + startTest = pyqtSignal(tuple) testResult = pyqtSignal(UTTestResult) testFinished = pyqtSignal(list, str) + testRunFinished = pyqtSignal(int, float) stop = pyqtSignal() + coverageDataSaved = pyqtSignal(str) module = "" name = "" runner = "" - def __init__(self, testWidget, logfile=None): + def __init__(self, testWidget): """ Constructor @param testWidget reference to the unit test widget @type UnittestWidget - @param logfile file name to log test results to (defaults to None) - @type str (optional) """ super().__init__(testWidget) self.__process = None - self._logfile = logfile - # TODO: add log file creation @classmethod def isInstalled(cls, interpreter):