[py-dev] hook ideas for better use/abuse of txspecs and distribution
Ronny Pfannschmidt
Ronny.Pfannschmidt at gmx.de
Wed Jul 22 12:33:27 CEST 2009
On Wed, 2009-07-22 at 11:55 +0200, holger krekel wrote:
> Hey Ronny,
>
> maybe it's good to also state your overall goal: running
> tests in virtualenv-environments with different packages
> pre-installed.
>
> On Wed, Jul 22, 2009 at 09:51 +0200, Ronny Pfannschmidt wrote:
> > Hi,
> >
> > i propose 2 new hooks to deal with more intresting aspects of test
> > distribution and txspecs
> >
> > 1. pytest_generate_gateways(config/session) -> list of execnet gateways
> >
> > this hook is supposed to generate the execnet gateways for test
> > execution
> >
> > the default implementation is supposed to just do what py.test currently
> > does
>
> probably rather a hook for setting a single gateway
>
> pytest_makegateway(txspec) -> execnet gateway
indeed seperation of generating specifications and turning them into
gateways makes sense
>
> because management of multiple nodes and their setup
> is its own concern - some nodes might not come up etc.
>
> In the --tx specifciation one could say e.g.
>
> popen//python=python2.5//virtualenv=docutils-0.5,mercurial-1.2
>
> and a pytest_virtualenv plugin could take it, call virtualenv
> and eventually start up a gateway with the venv/bin/python.
ok, how would i generate sets of txspec declarations,
cause i want to combine multiple arguments in order to generate the python versions and the package versions
>
> > howevers users should be free to generate own gateways to custom set up
> > things like virtualenvs on local or remote computers and be able to
> > combine txspecs with own options
>
> To get started, i would first try to get things working with
> popen, then extend to handle remote places - would you want
> to automatically install virtualenv there and/or require
> setuptools, btw?
>
> > 2. pytest_select_gateways(test, list of gateways) -> list of gateways
> >
> > this hook is supposed to select the gateways each test is supposed to
> > run on
>
> something like this could make sense. It's a second step, i'd think,
> though.
i would certainly need it
for example tests for mercurial would hardly work in a virtualenv thats
only only set up for bazaar
>
> Can you imagine working on a branch to try implement these hooks?
> I am willing to help/review.
sure
>
>
> > the default implementation should pass a test to all of them or
> > distribute them reasonable
> > the api for this one probably needs a few more idea since i think my
> > initial proposal is not adequate for all uses
>
> yes, working from concrete uses (a pytest_virtualenv
> plugin) makes sense.
>
More information about the Pytest-dev
mailing list