twisted.trial.unittest.SynchronousTestCase.callDeprecated(self, version, f, *args, **kwargs)
method documentationtwisted.trial.unittest.SynchronousTestCase
View Source
Call a function that should have been deprecated at a specific version and in favor of a specific alternative, and assert that it was thusly deprecated.
Parameters | version | A 2-sequence of (since, replacement), where since is a the
first version
that f should have been deprecated since, and
replacement is a suggested replacement for the deprecated
functionality, as described by twisted.python.deprecate.deprecated .
If there is no suggested replacement, this parameter may also be simply a
version
by itself. |
f | The deprecated function to call. | |
args | The arguments to pass to f . | |
kwargs | The keyword arguments to pass to f . | |
Returns | Whatever f returns. | |
Raises | Whatever f raises. If any exception is raised by
f , though, no assertions will be made about emitted
deprecations. | |
FailTest | if no warnings were emitted by f , or if the DeprecationWarning
emitted did not produce the canonical please-use-something-else message
that is standard for Twisted deprecations according to the given version
and replacement. |