[issue9424] Disable unittest.TestCase.assertEquals and assert_ during a regrtest run

Ezio Melotti report at bugs.python.org
Thu Aug 12 08:46:11 CEST 2010


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

It's not really a waste of time, since it's just a find and replace and I already have a patch ready. I also believe that there are valid reasons to do it.

When I started learning about unittest, I clearly remember asking myself if I should have used "assertEqual" or "assertEquals" and thought that two different methods with two different names probably did two different things (TMBOOWTDI).  I also remember thinking that "assertEquals" must have been a "plural" version of "assertEqual" able to accept more than two argument at once (i.e. assertEquals(a, b, c, d) -> a == b == c == d).

I can imagine people finding it in some code (possibly in the Python test suite), thinking that is a typo, being confused because the documentation doesn't mention it, wonder how the test can pass if they use a "ghost" method, asking themselves if the code is really executed and so on.

Since we are moving away from these methods, it's annoying seeing people using them and reintroduce them in the Python test suite and that wastes time during the commit reviews for the reviewer and for the committer that has to fix it and merge the fix.

This said, it could be enforced both in regrtest or with a commit hook.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9424>
_______________________________________


More information about the Python-bugs-list mailing list