pytest-dev / pytest-timeout

MIT License
216 stars 64 forks source link

Globally set per-test maximum duration? #13

Closed pytest-timeout-bot closed 6 years ago

pytest-timeout-bot commented 8 years ago

Original report by Flavian Hautboisa (Bitbucket: TraxAir, ).


Is there a way to set globally (either in setup.cfg on in a command-line option) the maximum duration per test? Right now I haven't come across one in the documentation.

pytest-timeout-bot commented 6 years ago

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


Simply run pytest --timeout=5 for a global timeout of 5s. You can also set timeout = 5 in the [pytest] section of the ini file as well as the PYTEST_TIMEOUT environment variable. All of this is the README and the --help output.