[TIP] including (or not) tests within your package

Olemis Lang olemis at gmail.com
Wed Jul 28 05:49:46 PDT 2010

On Tue, Jul 27, 2010 at 12:08 PM, Jesse Noller <jnoller at gmail.com> wrote:
> On Tue, Jul 27, 2010 at 10:04 AM, Barry Warsaw <barry at python.org> wrote:
>> On Jul 27, 2010, at 03:37 PM, Marius Gedminas wrote:
>>>On Tue, Jul 27, 2010 at 01:32:20PM +1000, Ben Finney wrote:
>>>> The trick then becomes management of the build script so that the
>>>> install step does *not* deploy the tests. Which requires thinking of
>>>> one's package as a package to be deployed, even though you're
>>>> deploying it in source form. From that point, it's a matter of
>>>> learning about Distutils and all the rest.
>>>Other than wasting a bit of disk space, what are the downsides of
>>>installing the tests?
>> To me, nothing.
>> +1 for including the tests by default.
> Agreed 100x with Barry -

IMO, tests shouldn't be installed in production systems ...

> additionally, tests are sometimes *better*
> then documentation for figuring out how to use, or the actual behavior
> of something.

That's what sdists are for ;o) . AFAICS, there is chance to satisfy
both reqs and still be minimalistic . The whole discussion is similar
to including docs inside a pkg . It is a fact that e.g. major Linux
distros put docs in a separate package

$ apt-cache search apache2 | grep "^apache"
apache2 - Next generation, scalable, extendable web server
apache2-doc - documentation for apache2

That would be similar in the context of tests in Python pkgs . Let's
say that , in this case , I'd like to include tests in deb-src (sdist)
but not in the ready-to-use deb (bdist_*) , while still keeping both
together in e.g. my VCS source tree (probably /me asking for too much
:-S , but I think it's still possible ...)



Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Soluciones Olimpiadas de Matemática IMO 2007 - Problema 4 -

More information about the testing-in-python mailing list