[pytest-dev] Is it valid to use --boxed with --capture=no?

holger krekel holger at merlinux.eu
Mon Sep 29 10:30:04 CEST 2014

On Mon, Sep 29, 2014 at 09:25 +0100, David Röthlisberger wrote:
> On Thu, Sep 25, 2014, at 01:59 PM, holger krekel wrote:
> > > I need to use "--boxed" to run each test in a different process, because
> > > very occasionally I get segfaults from the video-capture and
> > > image-processing libraries that I use, and I don't want that to bring
> > > down the rest of the tests.
> > 
> > With pytest-xdist-1.11 you can also run things with "py.test -n1" now which is
> > faster and will restart a crashed process if neccessary.  I expect "--boxed"
> > to be removed if "py.test -n1" proves to be a sufficient.
> "-n1" doesn't suffer from the same UnicodeEncodeError that "--boxed"
> suffers from, but it doesn't run each test in a separate process (and it
> turns out that I need each test run in a different process for other
> reasons related to the way I capture video from the system under test).
> So for now I'll switch to using a separate function for logging, instead
> of capturing std{out,err}.

I see.  The output capturing with pytest is not very configurable and
there are no particular hooks related to it.  If it's clear what would
be needed it could be implemented without much effort i guess.
Then again, running with "-s" and implementing your own capturing
fixtures (possibly with autouse=True) would also work.


More information about the Pytest-dev mailing list