[py-dev] [ANN] plugin: pytest-incremental

Eduardo Schettino schettino72 at gmail.com
Fri May 6 19:29:28 CEST 2011

On Mon, May 2, 2011 at 6:01 PM, meme dough <memedough at gmail.com> wrote:

> Hi,
> pytest-cov has pytest-xdist support.  It was a big reason for writing
> it (pytest-cov that is) and holger kindly added to the protocol
> between master / slave to allow info to travel that pytest-cov needed.
>  It is generic so you can use it too.
> Have a look at:
> https://bitbucket.org/memedough/pytest-cov/src/a7d65cc2458a/pytest_cov.py
> At pytest_sessionstart you can check if you are a master process or a
> slave process.  The most important thing to look for is if config has
> slaveinput.  If the config has that slaveinput then the process is a
> slave.  My one work with older pytest and 2.x too.  So that give you
> answer to non distributed testing process, master process or slave
> process.
> On master pytest_configure_node you get node.  On that put info in the
> node.slaveinput and pytest send it to the slave.  Look at DistMaster:
> https://bitbucket.org/memedough/cov-core/src/b9a3c9756366/cov_core.py
> On slave at pytest_sessionstart you can get the slaveinput.  Look at
> DistSlave.
> On slave at pytest_sessionfinish you put info in that
> config.slaveoutput dict to go back to the master.
> Then on the master at pytest_testnodedown you get the slaveoutput from
> the node that went down.
> So then at pytest_sessionfinish on master you know all slaves have
> finished and sent back info that been collected by master so can do
> stuff with it.
> Feel free to use anything from pytest-cov if useful for you.
> :)
Thanks Dough, it was very useful...

now pytest-incremental works for me with xdist -n. i could also run
--load=each but not sure it has the expected behaviour...

the code is here  https://bitbucket.org/schettino72/pytest-incremental

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20110507/5debb504/attachment.html>

More information about the Pytest-dev mailing list