Registry / testing / pytest-suite-timeout

pytest-suite-timeout

JSON →
library0.1.0pypypi✓ verified 82d ago

A pytest plugin that enforces a maximum execution time for the entire test suite, preventing runaway test runs. Version 0.1.0. Release cadence unknown (new library).

pip install pytest-suite-timeout
INSTALL
IMPORT
SIG · PYTEST-SUITE-TIMEO
P
pytest-suite-timeout
testingpythonv0.1.0
Install
2.7s avg
Import
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 30.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.7s · import 0.000s · 31MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SuiteTimeoutPlugin
import pytest_suite_timeout
from pytest_suite_timeout import SuiteTimeoutPlugin

Install and register the plugin via conftest.py or pytest.ini.

# conftest.py import pytest def pytest_addoption(parser): parser.addoption('--suite-timeout', action='store', default=None, type=int, help='Maximum suite execution time in seconds') def pytest_configure(config): timeout = config.getoption('--suite-timeout') if timeout: from pytest_suite_timeout import SuiteTimeoutPlugin config.pluginmanager.register(SuiteTimeoutPlugin(timeout)) # Then run: pytest --suite-timeout=300
Debug
Known issues
breakingBy default, the plugin does NOT abort the suite if timeout is exceeded; it only prints a warning. Use the 'abort' option to force stop.
fix
Set abort=True when initializing SuiteTimeoutPlugin: SuiteTimeoutPlugin(timeout, abort=True)
affects: <=0.1.0
gotchaThe timeout is measured from the start of the first test to the end of the last test, including collection time. If collection takes long, the timeout may trigger prematurely.
fix
Increase timeout to account for collection time, or use --collect-only to measure collection duration.
affects: All
gotchaThe plugin relies on the test suite being run in a single process. Parallel execution (e.g., pytest-xdist) is not supported and may cause undefined behavior.
fix
Avoid using with xdist, or ensure the plugin runs only in the master process (if supported in future).
affects: All
Upgrade
Version history
0.1.0latest on PyPI · released Jan 26, 2024
Audit
Dependencies
pytestrequiredRequired plugin hook
Agent activity
18 hits · last 30 days
node
16
Resources
pytest-suite-timeout — pip install pytest-suite-timeout · libregistry