[Twisted-Python] Re: [Twisted-commits] r18320 - Name functions in deprecation warnings
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
On 9/30/06, James Y Knight <foom@fuhm.net> wrote:
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?
I normally do this. I didn't in this case because TestCase.flushLoggedErrors isn't a full replacement. Still, from what I understand, these APIs were added for tests so it's probably worth documenting. cheers, jml
participants (2)
-
James Y Knight -
Jonathan Lange