[Python-Dev] Unittest PEP do's and don'ts (BDFL pronouncement)

Andrew Bennetts andrew-pythondev at puzzling.org
Thu Jul 17 03:45:56 CEST 2008


Ben Finney wrote:
> Andrew Bennetts <andrew-pythondev at puzzling.org> writes:
[...]
> > How is returning None a feature?
> 
> A test method having exactly one meaning is a feature. If it's
> consistent across the API, the API retains a level of simplicity.

Your reply makes no sense to me.

I am proposing that it should have exactly one meaning.  Callers will be free to
ignore the return value if they don't need it, and will see zero difference in
behaviour.

It seems you have a different meaning of “meaning” than I do, which suggests
that this conversation is doomed.  I hope I don't sound hostile, I'm just
bewildered.  Your argument isn't making any sense to me. 

I can of course keep using TestCase subclasses that override assertRaises to be
more useful.  And I will, because there are no actual downsides that I've seen
any evidence of.  I'd be even happier if the standard library adopted this
improvment, though.

-Andrew.



More information about the Python-Dev mailing list