[Twisted-Python] failUnlessFailure vs assertFailure

Glyph glyph at twistedmatrix.com
Thu Jan 4 00:36:35 MST 2018



> On Jan 3, 2018, at 1:19 PM, Craig Rodrigues <rodrigc at crodrigues.org> wrote:
> 
> Probably failUnlessFailure as an alias to assertFailure() was done to mimic some of the deprecations that occurred
> in the Python unittest module in Python 2.7: https://docs.python.org/2/library/unittest.html#deprecated-aliases <https://docs.python.org/2/library/unittest.html#deprecated-aliases>
> 
> It would probably be a good idea to change the usage of failUnlessFailure in twisted to assertFailure,
> and then deprecate failUnlessFailure.

This is a roughly accurate summary.

One minor quibble: it wasn't done to mimic "deprecations" - the failUnless aliases have been around since the very first release of PyUnit, and were in some circles considered the preferred form.  (In fact the first suggestion that one or the other should be deprecated, in 2008, is written by someone who was hoping to get rid of assert* and standardize on fail* :).)

But I agree, these aliases should be deprecated in Twisted as well.

-g

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20180103/38af7593/attachment-0002.html>


More information about the Twisted-Python mailing list