Part of twisted.trial View Source
Maintainer: Jonathan Lange
Class | SkipTest | Raise this (with a reason) to skip the current test. You may also set |
Class | FailTest | Raised to indicate the current test has failed to pass. |
Class | Todo | Internal object used to mark a TestCase as
'todo'. Tests marked 'todo' |
Function | makeTodo | Return a Todo object built
from value . |
Class | TestCase | A unit test. The atom of the unit testing universe. |
Class | UnsupportedTrialFeature | A feature of twisted.trial was used that pyunit cannot support. |
Class | PyUnitResultAdapter | Wrap a TestResult from the standard library's
unittest so that it |
Function | suiteVisit | Visit each test in suite with visitor . |
Class | TestSuite | Extend the standard library's TestSuite with support for
the visitor |
Class | TestDecorator | Decorator for test cases. |
Function | decorate | Decorate all test cases in test with
decorator . |
Function | __iter__ | Undocumented |
Function | _findlinestarts | Find the offsets in a byte code which are start of lines in the source. |
Class | _Warning | A _Warning
instance represents one warning emitted through the Python |
Function | _collectWarnings | Call f with args positional arguments and
kwargs keyword arguments |
Class | _Assertions | Replaces many of the built-in TestCase assertions. In general, these |
Class | _LogObserver | Observes the Twisted logs and catches any errors. |
Function | _clearSuite | Clear all tests from suite . |
Class | _PyUnitTestCaseAdapter | Adapt from pyunit.TestCase to ITestCase. |
Class | _BrokenIDTestCaseAdapter | Adapter for pyunit-style TestCase subclasses that have
undesirable id() |
Class | _ForceGarbageCollectionDecorator | Forces garbage collection to be run before and after the test. Any errors |
Function | _iterateTests | Iterate through all of the test cases in
testSuiteOrCase . |
Class | _SubTestCase | Undocumented |
Function | _deprecate | Internal method used to deprecate top-level assertions. Do not use this. |
Generate pairs (offset, lineno) as described in Python/compile.c.
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) , where
errors is either a single exception class or an iterable of
exception classes.
|
Returns | A Todo object.
|
f
with args
positional arguments and
kwargs
keyword arguments and collect all warnings which are
emitted as a result in a list.Parameters | observeWarning | A callable which will be invoked with a _Warning
instance each time a warning is emitted.
|
Returns | The return value of f(*args, **kwargs) .
|
suite
with visitor
.
Deprecated in Twisted 8.0.
Parameters | visitor | A callable which takes a single argument, the TestCase
instance to visit.
|
Returns | None |
suite
.
This messes with the internals of suite
. In particular, it
assumes that the suite keeps all of its tests in a list in an instance
variable called _tests
.
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 TestCase or TestSuite to decorate.
|
decorator | A unary callable used to decorate TestCase s.
| |
Returns | A decorated TestCase or a TestSuite containing
decorated TestCase s.
|
testSuiteOrCase
.