[pytest-dev] pytest overall execution timeout option

Bruno Oliveira nicoddemus at gmail.com
Mon Apr 18 09:54:45 EDT 2016


On Mon, Apr 18, 2016 at 10:47 AM Ronny Pfannschmidt <
ich at ronnypfannschmidt.de> wrote:

> the given simple implementation is called at the setup of a test  item and
> has effect after teardown of that test item
>
> (note how py.test took 1.69 seconds, even tho the timeout is 1 second and
> each test takes 0.5 seconds)
>
> the reason for that difference is that the exit condition is set at the
> setup of the test that will take 0.5 seconds, and then is checked after the
> teardown of that test in the py.test testloop
>
> to get more exact the check has to be done at test teardown,
>
> to get even more exact, you need to use tools similar to pytest-timeout
> and calculate exact maximum remaining run times in a fixture
>
> it would be helpful if you outlined your use-case a bit more exactly
> instead of the envisioned implementation as "global timeout"
>

Ronny is correct if one wants more control exactly when to stop.

>From the brief description provided by Shankar I assumed a "soft timeout"
was what he wanted, which is why I went for the simpler implementation
which achieves that.

Cheers,
Bruno.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20160418/be2d38e5/attachment.html>


More information about the pytest-dev mailing list