Skip to main content

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 minutes (600 seconds).

After installing both pytest-repeat and pytest-suite-timeout you can say:

$ pytest test_something.py::test_func --count=1000 --suite-timeout=600

That will run a test 1000 times, if that's less than 600 seconds. If it takes longer than 600 seconds, it will stop running new tests after 600 seconds.

Installation

From PyPI:

$ pip install pytest-suite-timeout

Usage

Specify the max suite time with --suite-timeout, in seconds (float).

Example of max 90 seconds:

$ pytest --suite-timeout=90

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

Release files for pytest-suite-timeout 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-suite-timeout 0.1.0
File Size Uploaded
pytest_suite_timeout-0.1.0.tar.gz 5.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-suite-timeout 0.1.0
File Interpreter ABI Platform
pytest_suite_timeout-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.3 kB

Release files / pytest_suite_timeout-0.1.0.tar.gz

Download URL pytest_suite_timeout-0.1.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2f536ed8906f0b159c5f20e58714180536fb9a9f786e5f6dfb148a54b0b543c4
BLAKE2b-256 checksum
How to use checksums
93e86d879dcad2e9b937c3694adf1cea0df3c646d9bc16d1a5088c937685d84b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / pytest_suite_timeout-0.1.0-py3-none-any.whl

Download URL pytest_suite_timeout-0.1.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb79bea59edbe36164cd6e09f124fda623ce2d97b71b2853c84f07ee1ba76228
BLAKE2b-256 checksum
How to use checksums
9388870b44fb8ccb2b63fd9b48b65eec557546eeb644b7d8bc860c3d77038cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page