class documentation

class ReportingResults: (source)

View In Hierarchy

A mutable container for the result of sending test results back to the parent process. Since it is possible for these sends to fail asynchronously but the L{TestResult} protocol is not well suited for asynchronous result reporting, results are collected on an instance of this class and when the runner believes the test is otherwise complete, it can collect the results and do something with any errors. :ivar _reporter: The L{WorkerReporter} this object is associated with. This is the object doing the result reporting. :ivar _results: A list of L{Deferred} instances representing the results of reporting operations. This is expected to grow over the course of the test run and then be inspected by the runner once the test is over. The public interface to this list is via the context manager interface.

Method __enter__ Begin a new reportable context in which results can be collected.
Method __exit__ End the reportable context.
Method record Record a Deferred instance representing one test result reporting operation.
Class Variable _reporter Undocumented
Class Variable _results Undocumented
def __enter__(self) -> Sequence[Deferred[object]]: (source)

Begin a new reportable context in which results can be collected. :return: A sequence which will contain the L{Deferred} instances representing the results of all test result reporting that happens while the context manager is active. The sequence is extended as the test runs so its value should not be consumed until the test is over.

def __exit__(self, excType: Type[BaseException], excValue: BaseException, excTraceback: TracebackType) -> Literal[False]: (source)

End the reportable context.

def record(self, result: Deferred[object]): (source)

Record a Deferred instance representing one test result reporting operation.

Undocumented

Undocumented