def __init__(self, name, result, **params): ''' Initializes the channel and ties it with provided ResultChannelHelper instance. ''' TestResultChannel.__init__(self, name, **params) self._result = result
def stopTest(self, result, device): """ Signals stop of execution of a test. """ TestResultChannel.stopTest(self, result, device) if self.isEnabled(): self._console.stopTest(result, device)
def __init__(self, name, progress, **params): ''' Initializes the channel and ties it with provided ProgressChannelHelper instance. ''' TestResultChannel.__init__(self, name, **params) self._progress = progress
def start(self, result): """ Signals start of execution of tests. """ TestResultChannel.start(self, result) if self.isEnabled(): self._console.start(result)
def startTest(self, result, device): ''' Processes a test start execution for the summary channel. ''' TestResultChannel.startTest(self, result, device) if isinstance(result, TestCaseResult): self._counters[STATUS_NOT_COMPLETED] += 1 self._counters[COUNTER_TESTS_RUN] += 1
def startTest(self, result, device): ''' Processes a test start execution for the stream channel. ''' TestResultChannel.startTest(self, result, device) formatters = (self._verboseFormats if self.isVerbose() else self._simpleFormats) self.write(self._format(result, formatters["start"], formatters, self._deviceAttrs(device))) self.write(self._formatResult(result, formatters, self._deviceAttrs(device)))
def stopTest(self, result, device): ''' Processes a test stop execution for the summary channel. ''' TestResultChannel.stopTest(self, result, device) if isinstance(result, TestCaseResult): self._counters[STATUS_NOT_COMPLETED] -= 1 self._counters[device.status] += 1 self._counters[_STOP_STAMP] = time.time() if device.cores: self._counters[COUNTER_CORE_DUMPS] += len(device.cores)
def stopTest(self, result, device): ''' Processes a test stop execution for the stream channel. ''' TestResultChannel.stopTest(self, result, device) formatters = (self._verboseFormats if self.isVerbose() else self._simpleFormats) self.write(self._format(result, formatters["stop"], formatters, self._deviceAttrs(device))) self.write(self._formatResult(result, formatters, self._deviceAttrs(device))) self.write(self._format(device.cores, formatters["cores"], formatters, self._basicAttrs(device))) self.write(self._format(device.errors, formatters["errors"], formatters, self._basicAttrs(device)))
def start(self, result): ''' Initializes all the channel counters. ''' TestResultChannel.start(self, result) stamp = time.time() self._counters = { _START_STAMP: stamp, _STOP_STAMP: stamp, COUNTER_N_TESTS: _countCaseResults(result), COUNTER_TESTS_RUN: 0, COUNTER_CORE_DUMPS: 0 } for status in STATUS_COUNTERS: self._counters[status] = 0
def startTest(self, result, device): ''' Signals start of execution of a test. ''' TestResultChannel.startTest(self, result, device) self._progress.startTest(result, device)
def __init__(self, name, stream=None, encoding=None, **params): TestResultChannel.__init__(self, name, **params) self._stream = stream or sys.stderr self._encoding = encoding or getattr(self._stream, "encoding", None)
def stopTest(self, result, device): ''' Signals stop of execution of a test. ''' TestResultChannel.stopTest(self, result, device) self._result.stopTest(result, device)
def stop(self): ''' Signals stop of execution of tests. ''' TestResultChannel.stop(self) self._result.stop()
def __init__(self, name, enabled=True, verbose=False, **params): TestResultChannel.__init__(self, name, enabled, verbose, **params) self._counters = {}
def __init__(self, name, console, **params): TestResultChannel.__init__(self, name, **params) self._console = console
def start(self, result): ''' Signals start of execution of tests. ''' TestResultChannel.start(self, result) self._result.start(result)