t.t.unittest : module documentation

Part of twisted.trial View Source

Things likely to be used by writers of unit tests.
Class FailTest Raised to indicate the current test has failed to pass.
Class SkipTest Raise this (with a reason) to skip the current test. You may also set method.skip to a reason string to skip it, or set class.skip to skip the entire TestCase.
Class SynchronousTestCase A unit test. The atom of the unit testing universe.
Class Todo No summary
Function makeTodo Return a Todo object built from value.
Class TestCase A unit test. The atom of the unit testing universe.
Class TestSuite Extend the standard library's TestSuite with support for the visitor pattern and a consistently overrideable run method.
Function suiteVisit Visit each test in suite with visitor.
Function decorate Decorate all test cases in test with decorator.
def makeTodo(value): (source)
Return a Todo object built from value.

If value is a string, return a Todo that expects any exception with value as a reason. If value is a tuple, the second element is used as the reason and the first element as the excepted error(s).

ParametersvalueA string or a tuple of (errors, reason), where errors is either a single exception class or an iterable of exception classes.
ReturnsA Todo object.
def suiteVisit(suite, visitor): (source)
Visit each test in suite with visitor.

Deprecated in Twisted 8.0.

ParametersvisitorA callable which takes a single argument, the TestCase instance to visit.
ReturnsNone
def decorate(test, decorator): (source)
Decorate all test cases in test with decorator.

test can be a test case or a test suite. If it is a test suite, then the structure of the suite is preserved.

decorate tries to preserve the class of the test suites it finds, but assumes the presence of the _tests attribute on the suite.

ParameterstestThe TestCase or TestSuite to decorate.
decoratorA unary callable used to decorate TestCases.
ReturnsA decorated TestCase or a TestSuite containing decorated TestCases.
API Documentation for Twisted, generated by pydoctor at 2013-04-03 11:20:05.