[Twisted-Python] Re: [Twisted-commits] r18320 - Name functions in deprecation warnings
James Y Knight
foom at fuhm.net
Fri Sep 29 16:16:20 EDT 2006
On Sep 28, 2006, at 10:30 PM, Jonathan Lange wrote:
> def flushErrors(*errorTypes):
> - """Support function for testing frameworks.
> + """
> + DEPRECATED in Twisted 2.5.
> +
> + Support function for testing frameworks.
>
> Return a list of errors that occurred since the last call to
> flushErrors().
> (This will return None unless startKeepingErrors has been
> called.)
> """
>
> + warnings.warn("Deprecated in Twisted 2.5",
> category=DeprecationWarning,
> + stacklevel=2)
As a general note, when deprecating something that is replaced by
something else, the original thing should mention what the new thing
is you should use instead. In this case, that'd be
"self.observer.flushErrors(...)", if you're using it in a test case,
I think?
James
More information about the Twisted-Python
mailing list