pytest-dev / pytest-timeout

MIT License
216 stars 64 forks source link

Timeout without error #20

Closed pytest-timeout-bot closed 6 years ago

pytest-timeout-bot commented 6 years ago

Original report by Anonymous.


Hey everyone,

currently, when a test exceeds the timeout limit and has to be stopped, it's handled as a failed test. Is there a way to stop the test after the timeout limit without handling it as an error?

Thanks a lot

pytest-timeout-bot commented 6 years ago

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


You would want the test to succeed despite it reaching the timeout? No that's not currently possible.

I'm also not sure if it should generally be possible to would be curious as to your usecase if you would like to elaborate. Bear in mind that it's not generally possible to say the timeout mechanism will succeed. Only the thread method is guaranteed to work and in this mode it would be impossible to make the test pass. If it's suitable for your use case it should be reasonably trivial to copy the sigalrm method however and not fail the test.

pytest-timeout-bot commented 6 years ago

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


Closing while no response, feel free to reopen.