class TestResult(pyunit.TestResult): (source)
Known subclasses: twisted.trial._dist.workerreporter.WorkerReporter
, twisted.trial.reporter.Reporter
Implements interfaces: twisted.trial.itrial.IReporter
Accumulates the results of several twisted.trial.unittest.TestCase
s.
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | add |
Report an error that occurred while running the given test. |
Method | add |
Report that the given test failed, and was expected to do so. |
Method | add |
Report a failed assertion for the given test. |
Method | add |
Report that the given test was skipped. |
Method | add |
Report that the given test succeeded. |
Method | add |
Report that the given test succeeded against expectations. |
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 |
Convert a sys.exc_info()-style tuple to a Failure , if necessary. |
Method | _get |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Instance Variable | _last |
The duration of the current test run. It defaults to None , which means that the test was skipped. |
Instance Variable | _start |
The time when the current test was started. It defaults to None , which means that the test was skipped. |
Instance Variable | _test |
Undocumented |
Instance Variable | _timings |
Undocumented |
Report an error that occurred while running the given test.
Parameters | |
test:pyunit.TestCase | Undocumented |
error:Failure or tuple | Undocumented |
twisted.trial._dist.workerreporter.WorkerReporter
, twisted.trial.reporter.TextReporter
, twisted.trial.reporter.TreeReporter
, twisted.trial.reporter.VerboseTextReporter
Report that the given test failed, and was expected to do so.
In Trial, tests can be marked 'todo'. That is, they are expected to fail.
Parameters | |
test:pyunit.TestCase | Undocumented |
error:Failure | Undocumented |
todo:unittest.Todo , or None , in which case a default todo message is provided. | Undocumented |
Report a failed assertion for the given test.
Parameters | |
test:pyunit.TestCase | Undocumented |
fail:Failure or tuple | Undocumented |
twisted.trial._dist.workerreporter.WorkerReporter
, twisted.trial.reporter.TextReporter
, twisted.trial.reporter.TreeReporter
, twisted.trial.reporter.VerboseTextReporter
Report that the given test was skipped.
In Trial, tests can be 'skipped'. Tests are skipped mostly because there is some platform or configuration issue that prevents them from being run correctly.
Parameters | |
test:pyunit.TestCase | Undocumented |
reason:str | Undocumented |
twisted.trial._dist.workerreporter.WorkerReporter
, twisted.trial.reporter.TextReporter
, twisted.trial.reporter.TreeReporter
, twisted.trial.reporter.VerboseTextReporter
Report that the given test succeeded.
Parameters | |
test:pyunit.TestCase | Undocumented |
twisted.trial._dist.workerreporter.WorkerReporter
, twisted.trial.reporter.TextReporter
, twisted.trial.reporter.TreeReporter
, twisted.trial.reporter.VerboseTextReporter
Report that the given test succeeded against expectations.
In Trial, tests can be marked 'todo'. That is, they are expected to fail. When a test that is expected to fail instead succeeds, it should call this method to report the unexpected success.
Parameters | |
test:pyunit.TestCase | Undocumented |
todo:unittest.Todo , or None , in which case a default todo message is provided. | Undocumented |
twisted.trial.reporter.Reporter
This must be called before the given test is commenced.
Parameters | |
test:pyunit.TestCase | Undocumented |
twisted.trial.reporter.VerboseTextReporter
This must be called after the given test is completed.
Parameters | |
test:pyunit.TestCase | Undocumented |
Report whether or not this test suite was successful or not.
The behaviour of this method changed in pyunit
in Python 3.4 to fail if there are any errors, failures, or unexpected successes. Previous to 3.4, it was only if there were errors or failures. This method implements the old behaviour for backwards compatibility reasons, checking just for errors and failures.
Returns | |
bool | Undocumented |
twisted.trial._dist.workerreporter.WorkerReporter
Convert a sys.exc_info()-style tuple to a Failure
, if necessary.
twisted.trial._dist.workerreporter.WorkerReporter
Undocumented
Value |
|
twisted.trial.reporter.Reporter
The time when the current test was started. It defaults to None
, which means that the test was skipped.