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

Grig Gheorghiu gheorghe_gheorghiu at yahoo.com
Wed Nov 12 13:44:56 PST 2008


--- On Wed, 11/12/08, Daryl Spitzer <daryl.spitzer at gmail.com> wrote:

> From: Daryl Spitzer <daryl.spitzer at gmail.com>
> Subject: Re: [TIP] Where to put unit tests? (What to name subdirectory?)
> To: "Fred Drake" <fdrake at gmail.com>
> Cc: tip at lists.idyll.org, testing-in-python at lists.idyll.org
> Date: Wednesday, November 12, 2008, 1:39 PM
> >> There is no clear distinction between different
> types of tests (unit
> >> vs. integration, etc.).
> >
> > You're right, there is no clear distinction. 
> Don't confuse readers of
> > your code by imposing one artificially.
> 
> I make a distinction, and I don't think it's
> imposed artificially.  My
> unit tests use test doubles and run very quickly, and do
> not require
> any resources.  Integration tests and system tests may use
> some test
> doubles, but run more slowly and are more likely to require
> resources
> like network storage or databases.

Then why not create sub-directories of 'tests' called unit, integration, acceptance, etc. You can have nose or py.test discover those directories too with some configuration-fu.

Grig



More information about the testing-in-python mailing list