[TIP] Guidelines for where to put tests & how to package them

Matt Harrison matthewharrison at gmail.com
Wed Feb 24 21:18:20 PST 2010


On Wed, Feb 24, 2010 at 10:01 PM, C. Titus Brown <ctb at msu.edu> wrote:
> Hi all,
>
> here at PyCon there have been a lot of packaging discussions, so I thought
> I'd spend a bit of time outlining some suggestions for where to put
> tests and how to run them.  It's been a bit of a thorn in the side of
> (among other things) continuous integration systems that there's no
> standard way to run Python tests... so let's fix that!
>
> I've produced a simple draft proposal & example where you put your unit tests
> under a package dir, somepackage/tests/.
>
> You can run these tests with
>
>  % python -m somepackage.tests.run
>
On Wed, Feb 24, 2010 at 10:01 PM, C. Titus Brown <ctb at msu.edu> wrote:
> Hi all,
snip, snip
> Comments?  Thoughts?  Complaints?  Issues I missed?
>

Looks good to me.  I'm all in favor of standards, and this should be a
boon to CI, and distributors as well (if they can just blow away the
test dir without worry).

I'm guessing, if there are "data" directories needed for tests they
should be found under test/ as well.  You might want to explicitly
state that, and maybe give an example of the convolution required to
make that work.

-matt



More information about the testing-in-python mailing list