pytest-dev / pytest-timeout

MIT License
216 stars 64 forks source link

Timeout just the test #24

Closed pytest-timeout-bot closed 6 years ago

pytest-timeout-bot commented 6 years ago

Original report by Pedro Algarvio (Bitbucket: [Pedro Algarvio](https://bitbucket.org/Pedro Algarvio), ).


Right now, the plugin includes all of the fixture prep work towards the actual test as part of the timeout. If we have enough prep work, bringing a DB daemon up, or similar, and a fairly low timeout value, we could hit timeout even before starting the actual testing.

By using pytest_pyfunc_call instead of pytest_runtest_protocol we could not include the fixture setup/teardown towards the actual timeout.

For backwards compatibility, this should probably be configurable.

pytest-timeout-bot commented 6 years ago

Original comment by Floris Bruynooghe (Bitbucket: flub, GitHub: flub).


Hi Pedro! Seems reasonable, what API did you have in mind to specify it? Another argument to the marker? Maybe combined with a default in the configuration file as well or is that overkill?

Anyway, if it's of use to you it would be great if you could contribute a patch for it!

Thanks

pytest-timeout-bot commented 6 years ago

Original comment by Pedro Algarvio (Bitbucket: [Pedro Algarvio](https://bitbucket.org/Pedro Algarvio), ).


Both your suggestions seem like the right path to take. What should we call the new option?

I'll try to code something up...

pytest-timeout-bot commented 6 years ago

Original comment by Pedro Algarvio (Bitbucket: [Pedro Algarvio](https://bitbucket.org/Pedro Algarvio), ).


timeout_defer for the INI option and defer for the marker argument?

pytest-timeout-bot commented 6 years ago

Original comment by Pedro Algarvio (Bitbucket: [Pedro Algarvio](https://bitbucket.org/Pedro Algarvio), ).


https://bitbucket.org/pytest-dev/pytest-timeout/pull-requests/9/allow-deferring-timeouts-to-the-test

pytest-timeout-bot commented 6 years ago

Original comment by Floris Bruynooghe (Bitbucket: flub, GitHub: flub).


Thank you so much for the work! And apologies for being so slow generally.