[pytest-dev] How to add delay before processing captured output
nicoddemus at gmail.com
Wed Feb 17 20:58:23 EST 2016
On Wed, Feb 17, 2016 at 7:07 PM Nikolaus Rath <Nikolaus at rath.org> wrote:
> Is there a way to add a delay that is (1) only incurred when a test
> fails and (2) executed right after the test fails (ie., before the capfd
> finalizer runs)?
One way to execute something right after the test function is to implement
the pytest_pyfunc_call, which is used to call python test functions:
outcome = yield
failed = outcome.excinfo is not None
You might even use marks to add this "wait time" only to marked functions,
instead of all tests.
I don't have time to look up and see if this will work with interaction
with the capture plugin, but it's worth a shot.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pytest-dev