unittest wart/bug for assertNotEqual

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Oct 22 03:34:35 EDT 2009


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?
2) Not exactly, but there are still inconsistencies (e.g. assertDictEqual  
and assertMultiLineEqual use != instead of ==, and some assertion messages  
use the wrong terminology)

-- 
Gabriel Genellina




More information about the Python-list mailing list