pytest-dev / pytest-timeout

MIT License
216 stars 64 forks source link

Add an option to use an environment variable for the timeout value #2

Closed pytest-timeout-bot closed 12 years ago

pytest-timeout-bot commented 12 years ago

Original report by Dave Hunt (Bitbucket: davehunt, GitHub: davehunt).


We have dozens of CI jobs and rather than add a configuration file or command line option to all of them, it would be great if we could just set an environment variable such as PYTEST_TIMEOUT to set the timeout globally.

pytest-timeout-bot commented 12 years ago

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


So timeout priority from high to low:

Does that sound correct? Or should the environment be at the bottom?

pytest-timeout-bot commented 12 years ago

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


Also, is there any argument to specify the method via the environment as well? I don't think so, but if you can think of a reason please say so.

pytest-timeout-bot commented 12 years ago

Original comment by Dave Hunt (Bitbucket: davehunt, GitHub: davehunt).


I think environment could safely be the lowest priority. You could also have PYTEST_TIMEOUT_METHOD but seeing as there's a suitable default value I think it can be omitted.