Test case related stuff.
Class TestSkipped Raised within TestCase.run() when a test is skipped.
Function run_test_with Decorate a test as using a specific RunTest.
Function gather_details Merge the details from source_dict into target_dict.
Class TestCase Extensions to the basic TestCase.
Function clone_test_with_new_id Copy a TestCase, and give the copied test a new id.
Function attr Decorator for adding attributes to WithAttributes.
Class WithAttributes A mix-in class for modifying test id by attributes.
Function skip A decorator to skip unit tests.
Function skipIf A decorator to skip a test if the condition is true.
Function skipUnless A decorator to skip a test unless the condition is true.
Class ExpectedException A context manager to handle expected exceptions.
Class Nullary Turn a callable into a nullary callable.
Class _UnexpectedSuccess An unexpected success was raised.
Class _ExpectedFailure An expected failure occured.
Function _expectedFailure Undocumented
Function _copy_content Make a copy of the given content object.
Function _clone_test_id_callback Copy a TestCase, and make it call callback for its id().
def _expectedFailure(func):
Undocumented
def run_test_with(test_runner, **kwargs):

Decorate a test as using a specific RunTest.

e.g.:

@run_test_with(CustomRunner, timeout=42)
def test_foo(self):
    self.assertTrue(True)

The returned decorator works by setting an attribute on the decorated function. TestCase.__init__ looks for this attribute when deciding on a RunTest factory. If you wish to use multiple decorators on a test method, then you must either make this one the top-most decorator, or you must write your decorators so that they update the wrapping function with the attributes of the wrapped function. The latter is recommended style anyway. functools.wraps, functools.wrapper and twisted.python.util.mergeFunctionMetadata can help you do this.

Parameterstest_runnerA RunTest factory that takes a test case and an optional list of exception handlers. See RunTest.
kwargsKeyword arguments to pass on as extra arguments to 'test_runner'.
ReturnsA decorator to be used for marking a test as needing a special runner.
def _copy_content(content_object):

Make a copy of the given content object.

The content within content_object is iterated and saved. This is useful when the source of the content is volatile, a log file in a temporary directory for example.

Parameterscontent_objectA content.Content instance.
ReturnsA content.Content instance with the same mime-type as content_object and a non-volatile copy of its content.
def gather_details(source_dict, target_dict):
Merge the details from source_dict into target_dict.
Parameterssource_dictA dictionary of details will be gathered.
target_dictA dictionary into which details will be gathered.
def _clone_test_id_callback(test, callback):

Copy a TestCase, and make it call callback for its id().

This is only expected to be used on tests that have been constructed but not executed.

ParameterstestA TestCase instance.
callbackA callable that takes no parameters and returns a string.
ReturnsA copy.copy of the test with id=callback.
def clone_test_with_new_id(test, new_id):

Copy a TestCase, and give the copied test a new id.

This is only expected to be used on tests that have been constructed but not executed.

def attr(*args):
Decorator for adding attributes to WithAttributes.
ParametersargsThe name of attributes to add.
ReturnsA callable that when applied to a WithAttributes will alter its id to enumerate the added attributes.
def skip(reason):

A decorator to skip unit tests.

This is just syntactic sugar so users don't have to change any of their unit tests in order to migrate to python 2.7, which provides the @unittest.skip decorator.

def skipIf(condition, reason):
A decorator to skip a test if the condition is true.
def skipUnless(condition, reason):
A decorator to skip a test unless the condition is true.
API Documentation for testtools, generated by pydoctor at 2015-07-01 16:11:28.