[TIP] unittest & TDD
bob at redivi.com
Sun Mar 4 17:24:56 PST 2007
On 3/4/07, Titus Brown <titus at caltech.edu> wrote:
> -> > In general, as much criticism as unittest has received for its
> -> > complexity, we've found it to be pretty useful for functional testing;
> -> > in fact, all of our tests--unit tests, functional tests, and manual
> -> > tests--use the unittest framework, which makes collecting the test
> -> > results easier for us.
> -> >
> -> Same here.
> -> I've never understood the unittest complexity issue - it seems
> -> straightforward to me ?? Perhaps it is a documentation issue.
> It's straightforward to people who "get" unit testing, I think ;).
> I don't think it's particularly complex; I don't like it because
> organizing hierarchies of tests is cumbersome. I find "discovery"
> frameworks like nose and py.test to be much nicer when organizing even
> medium-level test suites.
> Anyhoo, sort of OT, check out James Shore's latest chapter on TDD:
> Michael, I think it addresses some of the issues you brought up.
I agree that unittest is straightforward, but it's annoying (on its
own). Too much unnecessary cruft.
nose or py.test gives me everything I want though. I use a combination
of doctests and test functions. I use nose specifically because it
integrates better with setuptools, but I had previously used py.test.
More information about the testing-in-python