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

Michael Foord fuzzyman at voidspace.org.uk
Tue Jul 27 05:42:58 PDT 2010

On 27/07/2010 13:37, 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?
> For example, PyGame recently changed their distribution so the
> tests get installed and can be run by any end-user with
>    python -m pygame.tests.__main__
> (I think it's just 'python -m pygame.tests' for Python 2.7 and 3.x)

Yep, I'm in favour of deploying tests (as a sub-package). As you say, 
the only cost is a few kilobytes of disk space and it can be very 
helpful for end users to be able to run the tests and provide error 

Where a project is a single module, so there is nowhere for a 
sub-package to conveniently live, I tend to distribute the tests in the 
package but not have them installed by setup.py.

All the best,


> Marius Gedminas
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python


READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20100727/43026f4b/attachment.htm>

More information about the testing-in-python mailing list