twisted.trial.unittest module documentationtwisted.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 | SynchronousTestCase | A unit test. The atom of the unit testing universe. | 
| Class | PyUnitResultAdapter | No summary | 
| Class | Todo | No summary | 
| Function | makeTodo | Return a Todoobject built 
fromvalue. | 
| Class | TestCase | A unit test. The atom of the unit testing universe. | 
| Class | TestSuite | Extend the standard library's TestSuitewith a consistently
overrideablerunmethod. | 
| Class | TestDecorator | Decorator for test cases. | 
| Function | decorate | Decorate all test cases in testwithdecorator. | 
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).
| Parameters | value | A string or a tuple of (errors, reason), whereerrorsis either a single exception class or an iterable of 
exception classes. | 
| Returns | A Todoobject. | |
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.
| Parameters | test | The TestCaseorTestSuiteto decorate. | 
| decorator | A unary callable used to decorate TestCases. | |
| Returns | A decorated TestCaseor aTestSuitecontaining 
decoratedTestCases. | |