[Twisted-Python] failUnlessFailure vs assertFailure

Adi Roiban adi at roiban.ro
Wed Jan 3 04:29:55 MST 2018


Hi,

Do you know why we still have failUnlessFailure is an alias to
assertFailure? [1]

It looks like pydoctor does not include aliases as I don't see
failUnlessFailure in the HTML rendering
http://twistedmatrix.com/documents/current/api/twisted.trial.unittest.TestCase.html

Looking at the current code, I see that it is used only in a single
place in Twisted
https://github.com/twisted/twisted/search?utf8=%E2%9C%93&q=failUnlessFailure&type=

I see that in the past assertFailure was an alias for failUnlessFailure [2]

Is the plan to continue to have the alias? Maybe we can have a comment
before the alias.

Can we deprecate it?

Should pydoctor be updated to also show aliases of public methods?

Regards,

[1] https://github.com/twisted/twisted/blob/e38cc25a67747899c6984d6ebaa8d3d134799415/src/twisted/trial/_asynctest.py#L77

[2] https://github.com/twisted/twisted/commit/ce0b00de026a896b731d8794de2fd61b54a78a98
-- 
Adi Roiban



More information about the Twisted-Python mailing list