Part of twisted.trial View Source
This code is for Trial's internal use. Do NOT use this code if you are writing tests. It is subject to change at the Trial maintainer's whim. There is nothing here in this module for you to use unless you are maintaining Trial.
Any non-Trial Twisted code that uses this module will be shot.
Maintainer: Jonathan Lange
Class | DirtyReactorAggregateError | Passed to twisted.trial.itrial.IReporter.addError
when the reactor is |
Function | excInfoOrFailureToExcInfo | Coerce a Failure to an _exc_info, if err is a Failure. |
Function | suppress | Sets up the .suppress tuple properly, pass options to this method as you |
Function | profiled | Undocumented |
Function | getPythonContainers | Walk up the Python tree from method 'meth', finding its class, its module |
Function | acquireAttribute | Go through the list 'objects' sequentially until we find one which has |
Function | findObject | Get a fully-named package, module, module-global object or attribute. |
Class | _Janitor | The guy that cleans up after you. |
Function | _runSequentially | Run the given callables one after the other. If a callable returns a |
Parameters | err | Either a tuple such as returned by sys.exc_info or a Failure object.
|
Returns | A tuple like the one returned by sys.exc_info . e.g.
exception_type, exception_object, traceback_object .
|
So, to use this with a .suppress magic attribute you would do the following:
>>> from twisted.trial import unittest, util >>> import warnings >>> >>> class TestFoo(unittest.TestCase): ... def testFooBar(self): ... warnings.warn("i am deprecated", DeprecationWarning) ... testFooBar.suppress = [util.suppress(message='i am deprecated')] ... >>>
Note that as with the todo and timeout attributes: the module level
attribute acts as a default for the class attribute which acts as a default
for the method attribute. The suppress attribute can be overridden at any
level by specifying .suppress = []
Returns a tuple of (bool, obj). If bool is True, the named object exists and is returned as obj. If bool is False, the named object does not exist and the value of obj is unspecified.
Parameters | callables | An iterable of callables that take no parameters. |
stopOnFirstError | If True, then stop running callables as soon as one raises an exception or fires an errback. False by default. | |
Returns | A Deferred
that fires a list of (flag, value) tuples. Each tuple will be
either (SUCCESS, <return value>) or (FAILURE,
<Failure>) .
|