unittest wart/bug for assertNotEqual

Zac Burns zac256 at gmail.com
Tue Oct 20 19:20:54 CEST 2009


Using the assertNotEqual method of UnitTest (synonym for failIfEqual)
only checks if first == second, but does not include not (first !=
second)

According to the docs:
http://docs.python.org/reference/datamodel.html#specialnames
There are no implied relationships among the comparison operators. The
truth of x==y does not imply that x!=y is false

The name assertNotEqual to me implies a check using !=. This
misleading title can cause a programmer to think a test suite is
complete, even if __ne__ is not define - a common mistake worth
testing for.

Python 2.6

--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games



More information about the Python-list mailing list