A pytest plugin for ensuring max suite time
Project description
pytest-suite-timeout
A pytest plugin for ensuring max suite time.
Really though, it's: if the timeout expires, no new tests are started.
A use case
Works great in conjunction with pytest-repeat.
Say your debugging a flaky test and just want to run it a bunch of times, but not longer than say 10 minuts.
After installing both pytest-repeat
and pytest-suite-timeout
you can say:
$ pytest test_something.py::test_func --count=1000 --suite-timeout=10
That will run a test 1000 times, if that's less than 10 minutes. If it takes longer than 10 minutes, it will exit pytest after 10 minutes-ish.
Installation
From PyPI:
$ pip install pytest-suite-timeout
Usage
Specify the max suite time with --suite-timeout
, in minutes (float).
Example of max 1.5 minutes:
$ pytest --suite-timeout=1.5
Defaults to no timeout
If you don't pass in --suite-timeout
, nothing happens.
Timeout behavior
Timeout is done between tests.
If a timeout is noticed, pytest.exit()
is called, stopping all further testing.
Contributing
Contributions are welcome. Tests can be run with tox. Test coverage is now 100%. Please make sure to keep it at 100%. If you have an awesome pull request and need help with getting coverage back up, let me know.
License
Distributed under the terms of the MIT license, "pytest-suite-timeout" is free and open source software
Issues
If you encounter any problems, please file an issue along with a detailed description.
Changelog
See changelog.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_suite_timeout-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4047b30ff41229d7cc3862558785b991afa7c256b4fccb51801e495ef696c1ae |
|
MD5 | e9825ab17ca2b0551cc098d04b423afb |
|
BLAKE2b-256 | 6132c1234be2a813599f96147ce0c66f39d21f4c8d2a10a9283a1cd707f81e55 |
Hashes for pytest_suite_timeout-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe23362f37a0859941c2d7c3039b8ff90a782fc58d424a5c6865b0d40608c1f1 |
|
MD5 | 516e78d2885c7f6fa4843025f49f00e8 |
|
BLAKE2b-256 | 1fe8dfd35097630848302273f5f92448030b4c6077bc88de78febaa8cc05c46e |