Unittest testing assert*() calls rather than methods?

Roy Smith roy at panix.com
Wed Sep 28 22:49:58 EDT 2011


In article <874nzw3wxc.fsf at benfinney.id.au>,
 Ben Finney <ben+python at benfinney.id.au> wrote:

> Roy Smith <roy at panix.com> writes:
> 
> > In article <87k48szqo1.fsf at benfinney.id.au>,
> >  Ben Finney <ben+python at benfinney.id.au> wrote:
> >
> > > Worse, if one of the scenarios causes the test to fail, the loop will
> > > end and you won't get the results for the remaining scenarios.
> >
> > Which, depending on what you're doing, may or may not be important.  In 
> > many cases, there's only two states of interest:
> >
> > 1) All tests pass
> >
> > 2) Anything else
> 
> For the purpose of debugging, it's always useful to more specifically
> narrow down the factors leading to failure.

Well, sure, but "need to debug" is just a consequence of being in state 
2.  If a test fails and I can't figure out why, I can always go back and 
add additional code to the test case to extract additional information.



More information about the Python-list mailing list