[pytest-dev] pytest overall execution timeout option

Floris Bruynooghe flub at devork.be
Wed Apr 20 12:30:30 EDT 2016


On 20 April 2016 at 17:04, Bruno Oliveira <nicoddemus at gmail.com> wrote:
> On Wed, Apr 20, 2016 at 11:01 AM Shankar Hiremath
> <shankarhiremath2006 at gmail.com> wrote:
>>
>> As part of “pytest_sessionfinish” we are doing few major activities
>> (collecting cluster logs, artifacts, screen shots & videos of testing and
>> moving to central location),
>> so if kill the pytest based on global timeout then i will lose all the
>> important data which is required for analyzing.
>
>
> Oh right, forgot you mentioned that.
>
> Currently pytest-timeout kills the process when a test times out,

With the signal method (default if you're on unix) it raises an
pytest.fail.Exception from inside the signal handler, which means it
gets raised from inside the test function call, the test fails and
then finalizers run just normal.  However not all code can be
interrupted this way, works most of the time though.


More information about the pytest-dev mailing list