Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coverage #47

Open
kfox1111 opened this issue May 11, 2018 · 1 comment
Open

coverage #47

kfox1111 opened this issue May 11, 2018 · 1 comment

Comments

@kfox1111
Copy link

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.

@bitranox
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants