class documentation
class WorkerReporter(TestResult): (source)
Constructor: WorkerReporter(ampProtocol)
Reporter for trial's distributed workers. We send things not through a stream, but through an AMP protocol's callRemote method.
Method | __init__ |
No summary |
Method | add |
Send an error to the parent process. |
Async Method | add |
Attempt to report an error to the parent process. |
Method | add |
Send an expected failure over. |
Method | add |
Send a Failure over. |
Method | add |
Send a skip over. |
Method | add |
Send a success to the parent process. |
Method | add |
Send an unexpected success over. |
Method | gather |
Get a "result reporting" context manager. |
Method | print |
Don't print a summary |
Instance Variable | amp |
Undocumented |
Method | _call |
Call f if and only if a "result reporting" context is active. |
Method | _get |
Convert a sys.exc_info()-style tuple to a Failure , if necessary. |
Method | _get |
Extract frames from a Failure instance. |
Method | _get |
Get the reason for a Todo. |
Constant | _DEFAULT |
Default message for expected failures and unexpected successes, used only if a Todo is not provided. |
Instance Variable | _reporting |
When a "result reporting" context is active, the corresponding context manager. Otherwise, None . |
Inherited from TestResult
:
Method | __repr__ |
Undocumented |
Method | done |
The test suite has finished running. |
Method | start |
This must be called before the given test is commenced. |
Method | stop |
This must be called after the given test is completed. |
Method | was |
Report whether or not this test suite was successful or not. |
Instance Variable | expected |
Undocumented |
Instance Variable | skips |
Undocumented |
Instance Variable | successes |
count the number of successes achieved by the test run. |
Instance Variable | unexpected |
Undocumented |
Method | _get |
Undocumented |
Instance Variable | _last |
Undocumented |
Instance Variable | _test |
Undocumented |
Instance Variable | _timings |
Undocumented |
Parameters | |
amp | The communication channel with the trial distributed manager which collects all test results. |
Send a success to the parent process.
This must be called in context managed by gatherReportingResults
.
Get a "result reporting" context manager.
In a "result reporting" context, asynchronous test result reporting methods may be used safely. Their results (in particular, failures) are available from the context manager.
Call f
if and only if a "result reporting" context is active.
Parameters | |
f:Callable[ | A function to call. Its result is accumulated into the result reporting context. It may return a Deferred or a coroutine or synchronously raise an exception or return a result value. |
Raises | |
ValueError | If no result reporting context is active. |