[issue10273] Clean-up Unittest API

Ezio Melotti report at bugs.python.org
Thu Nov 4 12:53:02 CET 2010


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

It should be noted that, if we re-use assertSameElements, the default behavior should be preserved for compatibility with 3.1, and that is different (and possibly less useful) than the one of assertItemsEqual. Ambiguities could be solved easily specifying the args explicitly every time though.

Regarding assertLT I'm still -1. The current names are imho the best compromise between being short and descriptive.
They also match nicely assertEqual (assertLT <-> assertEQ; assertLessThan <-> assertEqualTo; but assertLess <-> assertEqual).
Also it might not be immediately obvious what assertGE does, if one is not familiar with the special methods or if taken out of context (it's easy to recognize it if it's together with assertLT/LE/GT, but alone might just look a specialized method with a bad name).
Moreover people who are used to the current spelling will have to notice the change, note that one name is now deprecated, update their code, remember if the correct name is assertLess or assertLT, wonder if assertEqual has been deprecated in favor of assertEQ too, remember the version where the name changed (e.g. if they try assertLT on 3.1 it won't work) and so on.

----------

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


More information about the Python-bugs-list mailing list