On Mon, Apr 18, 2016 at 10:47 AM Ronny Pfannschmidt < [email protected]> 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.
_______________________________________________ pytest-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pytest-dev
