[TIP] RFF: Article on python test design pattern - DAI

Aaron Maxwell amax at redsymbol.net
Wed Dec 9 22:24:09 PST 2009

Thanks so much everyone for the comments.  My replies follow.

On Tuesday 08 December 2009 06:55:38 am exarkun at twistedmatrix.com wrote:
> Nice write-up.  


> The difference is that I try to avoid actually performing the assertion
> in injected function itself.   Since unittest uses exceptions to signal 
> test failures, I always worry a bit about the SUT catching the exception
> and suppressing the failure.  So, instead, I capture objects and save
> them for later inspection.

That's interesting, I had not thought of that possibility. Good point.  I 
think with some awareness, it's easy enough to avoid that the tradeoff is 
worth it, though.

Aaron Maxwell

More information about the testing-in-python mailing list