[TIP] Guidelines for where to put tests & how to package them
olemis at gmail.com
Thu Feb 25 08:01:44 PST 2010
On Thu, Feb 25, 2010 at 9:56 AM, Olemis Lang <olemis at gmail.com> wrote:
> On Thu, Feb 25, 2010 at 12:01 AM, 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!
> We're gonna save the world . Great !
>> I've produced a simple draft proposal & example where you put your unit tests
>> under a package dir, somepackage/tests/.
> I'll take a look in a while ...
Firstly I'd like to know something
- What are the goals ? Just remove tests when installing packages
and (use | run | keep) them at (build | dev) time ?
If that's the only goal, well, at least right now I think that `tests`
dir might be useful
>> % python -m somepackage.tests.run
> It's great for the start, but I prefer
> `python setup.py test -m somepackage.test.run`
> (not sure about `test.run` yet ...) for testing everything in there
I think I'd definitely prefer `python setup.py test -m
somepackage.tests` (i.e. using the distutils command and discarding
the `run` thing ;o)
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Support micro-seconds as added by Trac in revision 9210 for upcoming
0.12. Fixes the two inst... -
More information about the testing-in-python