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

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


--- On Wed, 11/12/08, C. Titus Brown <ctb at msu.edu> wrote:

> On Wed, Nov 12, 2008 at 12:41:14PM -0800, Daryl Spitzer
> wrote:
> -> Is there a convention for where to put unit tests?
> -> 
> -> But a colleague states that the python stdlib's
> tests are in a
> -> subdirectory called "tests".  Should I
> consider that a convention and
> -> stick with it (in spite of its disadvantages)?
> 
> That's how I do it; I believe both nose and py.test
> will discover tests
> under 'tests/', and I've seen it in other
> packages, too.

...or you can run cheesecake [1] on your package and it'll tell you where it expects your tests to be :-)

[1] http://pycheesecake.org/

Grig



More information about the testing-in-python mailing list