unittest wart/bug for assertNotEqual
Ethan Furman
ethan at stoneleaf.us
Thu Oct 22 09:27:35 EDT 2009
Gabriel Genellina wrote:
> En Tue, 20 Oct 2009 19:57:19 -0300, Ethan Furman <ethan at stoneleaf.us>
> escribió:
>> Steven D'Aprano wrote:
>>> On Tue, 20 Oct 2009 14:45:49 -0700, Zac Burns wrote:
>
>>>> My preference would be that failIfEqual checks both != and ==. This is
>>>> practical, and would benefit almost all use cases. If "!=" isn't "not
>>>> ==" (IEEE NaNs I hear is the only known use case)
>
>>> numpy uses == and != as element-wise operators:
>
>> Two issues: 1) Sounds like we should have two more Asserts --
>> failIfNotEqual, and assertNotNotEqual to handle the dichotomy in
>> Python; and 2) Does this mean (looking at Mark Dickinson's post) that
>> 2.7 and 3.1 are now broken?
>
> 1) assertEqual and assertNotEqual test for == and != respectively. The
> failXXX methods are being deprecated. Why do you think we need more
> asserts?
Ignorance, of course. :) I didn't know those were there. Hopefully
the OP will also now realize those are there.
> 2) Not exactly, but there are still inconsistencies (e.g.
> assertDictEqual and assertMultiLineEqual use != instead of ==, and some
> assertion messages use the wrong terminology)
More information about the Python-list
mailing list