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

C. Titus Brown ctb at msu.edu
Wed Feb 24 21:01:51 PST 2010


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

and you can also do (if setuptools/distribute is installed)

  % python setup.py test

---

Full source at http://github.com/ctb/SomePackage or downloadable
at

   http://lyorn.idyll.org/~t/transfer/SomePackage.tar.gz

Comments?  Thoughts?  Complaints?  Issues I missed?

thanks,
--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the testing-in-python mailing list