[TIP] Where to put unit tests? (What to name subdirectory?)

Michael Gratton michael at quuxo.com
Wed Nov 12 16:07:30 PST 2008


On Wed, 2008-11-12 at 13:05 -0800, Daryl Spitzer wrote:
> > What are the disadvantages?
> 
> There is no clear distinction between different types of tests (unit
> vs. integration, etc.).
> 
> Though Cosmin Stejerean tweeted
> (http://twitter.com/offbytwo/status/1002689003) that "if you use nose
> and have a tests/integration/ folder with no __init__.py you can run
> them selectively using -i integration"

I like Cosmin Stejerean's approach - by separating unit from integration
tests, you can easily do things like automatically run only your unit
tests during a commit and save integration tests for when it is more
appropriate.

For larger systems, I tend to have a separate project for integration
tests, then put only unit tests in each project's "test" directory. This
also maintains the distinction well.

/Mike

-- 
Michael Gratton <michael at quuxo.com>     
Quuxo Software <http://web.quuxo.com/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20081113/f30c7209/attachment.pgp 


More information about the testing-in-python mailing list