[Python-Dev] Proposed unittest changes

Steven D'Aprano steve at pearwood.info
Tue Jul 15 15:42:23 CEST 2008


On Tue, 15 Jul 2008 04:55:59 pm Thomas Lotze wrote:

> I'm surprised nobody (that I've noticed) has brought up the point yet
> that test code is a lot easier to read if it makes positive
> assertions. 

Please don't claim that your subjective opinion is an objective fact.


> When reading failure conditions, one has to constantly 
> invert them in order to deduce the behaviour that is tested.

You might have to. Don't assume that everyone else has your difficulty.


> failUnless and friends aren't better either IMO since while they do
> work with positive assertions, the method names themselves are doubly
> negative. assert* methods are so much more straightforward to
> comprehend.

Maybe for you. That's not a human universal. Please don't assume that 
your favourite bike-shed colour must be the favourite colour of 
everyone else too.



-- 
Steven


More information about the Python-Dev mailing list