[pytest-dev] Advice for writing a failure bisection plugin

Floris Bruynooghe flub at devork.be
Sun Nov 4 06:10:19 EST 2018


On Sun 04 Nov 2018 at 02:47 +0100, Daniel Hahler wrote:

> On 03.11.18 08:54, Craig de Stigter wrote:
> > However, I note the excellent pytest-xdist plugin is good at
> > spawning worker subprocesses and sending tests to them, and rather
> > than re-invent the wheel I wondered if I could make my plugin depend
> > on xdist, and /control/ the xdist workers (e.g. run one worker with
> > all the tests; if it crashes, run a new worker with half the tests,
> > etc).
>
> I do not think xdist is a good fit here, since you do not want to run
> the tests distributed (like you correctly said).

xdist might not be such a bad fit.  It has several ways of distributing
the tests to processes: all tests to each process, distributed etc.  It
also already re-starts processes.  So you might be able to write an
xdist hook to chunk the tests in the way you like, re-running failed
tests etc.

I'm saying this all with last time having worked on xdist O(years) ago
though, so hey.


Cheers,
Floris


More information about the pytest-dev mailing list