timeout-decorator icon indicating copy to clipboard operation
timeout-decorator copied to clipboard

coverage

Open kfox1111 opened this issue 7 years ago • 1 comments

I'm using timeout_decorator.timeout to decorate my unit tests to ensure bugs in threaded code doesn't block the tests forever but fail the tests gracefully. But it seems to cause coverage testing during unit tests to ignore the decorated tests.

kfox1111 avatar May 11 '18 00:05 kfox1111

Maybe thats the reason why : By default, timeout-decorator uses signals to limit the execution time of the given function. This appoach does not work if your function is executed not in a main thread. There is alternative timeout strategy for this case - by using multiprocessing. You can force not to use signals on Linux by passing the parameter use_signals=False to the timeout decorator function (mostly for testing)

If You use my fork, this is done automatically, so in case the decorator does not run in the main thread, signals are disabled automatically.

see: https://github.com/bitranox/wrapt-timeout-decorator

yours sincerely

Robert

bitranox avatar May 11 '18 07:05 bitranox