testtools.tests.helpers.LoggingResult(TestResult)
class documentationtesttools.tests.helpers
(View In Hierarchy)
Method | __init__ | Undocumented |
Method | startTest | Undocumented |
Method | stop | Undocumented |
Method | stopTest | Undocumented |
Method | addFailure | Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info(). |
Method | addError | Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info(). |
Method | addSkip | Called when a test has been skipped rather than running. |
Method | addSuccess | Called when a test succeeded. |
Method | startTestRun | Called before a test run starts. |
Method | stopTestRun | Called after a test run completes |
Method | done | Called when the test runner is done. |
Method | tags | Add and remove tags from the test. |
Method | time | Provide a timestamp to represent the current time. |
Inherited from TestResult:
Instance Variable | skip_reasons | A dict of skip-reasons -> list of tests. See addSkip. |
Method | addExpectedFailure | Called when a test has failed in an expected manner. |
Method | addUnexpectedSuccess | Called when a test was expected to fail, but succeed. |
Method | wasSuccessful | Has this result been successful so far? |
Method | current_tags | The currently set tags. |
Method | _err_details_to_string | Convert an error in exc_info form or a contents dict to a string. |
Method | _exc_info_to_unicode | Undocumented |
Method | _now | Return the current 'test time'. |
Parameters | details | Alternative way to supply details about the outcome. see the class docstring for more information. |
Parameters | details | Alternative way to supply details about the outcome. see the class docstring for more information. |
Called when a test has been skipped rather than running.
Like with addSuccess and addError, testStopped should still be called.
This must be called by the TestCase. 'addError' and 'addFailure' will not call addSkip, since they have no assumptions about the kind of errors that a test can raise.
Parameters | test | The test that has been skipped. |
reason | The reason for the test being skipped. For instance, u"pyGL is not available". | |
details | Alternative way to supply details about the outcome. see the class docstring for more information. | |
Returns | None |
Called before a test run starts.
New in Python 2.7. The testtools version resets the result to a pristine condition ready for use in another test run. Note that this is different from Python 2.7's startTestRun, which does nothing.
Parameters | new_tags | A set of tags to be added to the stream. |
gone_tags | A set of tags to be removed from the stream. |
Provide a timestamp to represent the current time.
This is useful when test activity is time delayed, or happening concurrently and getting the system time between API calls will not accurately represent the duration of tests (or the whole run).
Calling time() sets the datetime used by the TestResult object. Time is permitted to go backwards when using this call.
Parameters | a_datetime | A datetime.datetime object with TZ information or None to reset the TestResult to gathering time from the system. |