[Distutils] Where should I put tests when packaging python modules?

Wes Turner wes.turner at gmail.com
Tue Oct 6 11:51:44 CEST 2015


On Oct 6, 2015 4:24 AM, "David Cournapeau" <cournape at gmail.com> wrote:
>
>
>
> On Tue, Oct 6, 2015 at 9:30 AM, Ionel Cristian Mărieș <contact at ionelmc.ro>
wrote:
>>
>>
>> On Tue, Oct 6, 2015 at 10:51 AM, Antoine Pitrou <solipsis at pitrou.net>
wrote:
>>>
>>> They should be inside the module. That way, you can check an installed
>>> module is ok by running e.g. "python -m mypackage.tests". Any other
>>> choice makes testing installed modules more cumbersome.
>>
>>
>> ​Does that really make sense? I haven't heard of any user actually
running tests​
>> that way. To be honest I haven't ever ran Python's own tests suite as
part
>> of a user installation.
>
>
> It makes a lot of sense for downstream packagers. Allowing testing
installed packages is also the simplest way to enable testing on target
machines which are different from the build machines.

self-testable programs are really ideal (e.g POST power-on self test)
relevant recent topical discussion of e.g
CRC and an optional '-t' preemptive CLI parameter:
https://github.com/audreyr/cookiecutter-pypackage/pull/52

>
> David
>
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20151006/8cad4bef/attachment.html>


More information about the Distutils-SIG mailing list