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

Ionel Cristian Mărieș contact at ionelmc.ro
Tue Oct 6 14:34:38 CEST 2015


On Tue, Oct 6, 2015 at 3:13 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> On Tue, 6 Oct 2015 07:07:31 -0400
> Donald Stufft <donald at stufft.io> wrote:
> >
> > I've never, in my entire life [...]
>
> Can I suggest your entire life is an anecdotal data point here?
>

​Make that two anecdotal data points :-)​

Any number of things can be described as trivial depending on the
> skillset and patience of the user.  When users report a bug, they are
> not expecting to be asked to download and "untar" stuff.  Not every
> user is a programmer.
>
​
But seriously now, your arguments are also anecdotal. Lets not pretend
we're objective here. That sort of attitude is disingenuous and will
quickly devolve this discussion to mere ad hominems.
​


> It's not trivial, because if you aren't careful you'll be running them
> against the tarball / checkout instead (because of Python munging the
> PYTHONPATH behind your back, for example), and this can go unnoticed for
> a long time.
>

​This is a flaw of the project layout really. If you don't isolate your
sources from the import paths then you're probably testing the wrong way.
In other words, you're probably not testing the installed code. Very few
test runners change the current working directory by default [1], so it's
better to just get a better project layout. pyca/cryptography
<https://github.com/pyca/cryptography> is a good example.​

​[1] trial is the only one that I know of, and it's hardly popular for
testing anything but projects that use Twisted​.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20151006/fd444452/attachment-0001.html>


More information about the Distutils-SIG mailing list