class documentation

class twisted.trial.reporter.SubunitReporter: (source)

Implements interfaces: twisted.trial.itrial.IReporter

View In Hierarchy

Reports test output via Subunit.

Present Since10.0
Class Variable testsRun The number of tests that seem to have been run according to this reporter.
Method __init__ Construct a SubunitReporter.
Method done Record that the entire test suite run is finished.
Property shouldStop Whether or not the test runner should stop running tests.
Method stop Signal that the test runner should stop running tests.
Method wasSuccessful Has the test run been successful so far?
Method startTest Record that test has started.
Method stopTest Record that test has completed.
Method addSuccess Record that test was successful.
Method addSkip Record that test was skipped for reason.
Method addError Record that test failed with an unexpected error err.
Method addFailure Record that test failed an assertion with the error err.
Method addExpectedFailure Record an expected failure from a test.
Method addUnexpectedSuccess Record an unexpected success.
Instance Variable _subunit The subunit protocol client that we are wrapping.
Instance Variable _successful An internal variable, used to track whether we have received only successful results.
_subunit = (source)
The subunit protocol client that we are wrapping.
_successful = (source)
An internal variable, used to track whether we have received only successful results.
(type: bool)
testsRun = (source)

The number of tests that seem to have been run according to this reporter.

def __init__(self, stream=sys.stdout, tbformat='default', realtime=False, publisher=None): (source)

Construct a SubunitReporter.

ParametersstreamA file-like object representing the stream to print output to. Defaults to stdout.
tbformatThe format for tracebacks. Ignored, since subunit always uses Python's standard format.
realtimeWhether or not to print exceptions in the middle of the test results. Ignored, since subunit always does this.
publisherThe log publisher which will be preserved for reporting events. Ignored, as it's not relevant to subunit.
def done(self): (source)

Record that the entire test suite run is finished.

We do nothing, since a summary clause is irrelevant to the subunit protocol.

@property
shouldStop = (source)

Whether or not the test runner should stop running tests.

def stop(self): (source)

Signal that the test runner should stop running tests.

def wasSuccessful(self): (source)

Has the test run been successful so far?

ReturnsTrue if we have received no reports of errors or failures, False otherwise.
def startTest(self, test): (source)

Record that test has started.

def stopTest(self, test): (source)

Record that test has completed.

def addSuccess(self, test): (source)

Record that test was successful.

def addSkip(self, test, reason): (source)

Record that test was skipped for reason.

Some versions of subunit don't have support for addSkip. In those cases, the skip is reported as a success.

ParameterstestA unittest-compatible TestCase.
reasonThe reason for it being skipped. The str() of this object will be included in the subunit output stream.
def addError(self, test, err): (source)

Record that test failed with an unexpected error err.

Also marks the run as being unsuccessful, causing SubunitReporter.wasSuccessful to return False.

def addFailure(self, test, err): (source)

Record that test failed an assertion with the error err.

Also marks the run as being unsuccessful, causing SubunitReporter.wasSuccessful to return False.

def addExpectedFailure(self, test, failure, todo=None): (source)

Record an expected failure from a test.

Some versions of subunit do not implement this. For those versions, we record a success.

def addUnexpectedSuccess(self, test, todo=None): (source)

Record an unexpected success.

Since subunit has no way of expressing this concept, we record a success on the subunit stream.

API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.