[TIP] pytest, making a standalone script with extensions
Michael Foord
michael at voidspace.org.uk
Sat Dec 3 07:20:13 PST 2011
On 03/12/2011 13:15, francis wrote:
>
> Hi all,
> I've started evaluating and playing with pytest to use it as a
> replacement of our
> actual test script and some questions arose (sorry If too trivial):
>
> I would like too used it as standalone script (“--genscript” option)
> so that I can
> integrate it into the repository and so coworkers don't have to
> “install yet another
> python package or decency” (is that a good practice?).
In general the answer is no, bundling your dependencies is not
considered good practise. It puts code that isn't yours (and shouldn't
be modified) into your version control repository and actively prevents
you from getting bug fixes or updates. Especially if you have other
dependencies anyway, it is better to use pip to fetch dependencies when
you create your development environment.
One alternative is to run your own "mirror" of pypi for your specific
dependencies (it can actually just be a plain directory of files served
by Apache), updated from a cron job, and point pip at that. That allows
your infrastructure to be completely under your control and not be
dependent on an external resource (pypi). You do then have to manage
getting updated versions yourself.
All the best,
Michael Foord
> To do that I hat to install
> the package and it's dependencies locally manually first (as I got a
> timeout
> using pip and easy_install) and then I've generated the standalone
> script. Is there
> a way to do that without first having to installing it?
>
> I would like to use the extension 'xdist'. Is there a way to generate
> a standalone
> with this extension integrated in it?
>
> Thanks in advance !
>
> Francis
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
--
http://www.voidspace.org.uk/
May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
More information about the testing-in-python
mailing list