pytest-timeouts
Linux-only Pytest plugin to control durations of various test case execution phases
What it is and what it does
pytest-timeouts is a pytest plugin that lets you set independent timeout limits for the setup, execution, and teardown phases of a test case. Unlike generic test timeouts, it breaks down test lifecycle into three stages and allows you to control each one separately via command-line options, pytest.ini configuration, or per-test markers. It uses SIGALRM signals to enforce these limits and disables timeouts when running under a debugger.
The plugin is Linux-only and has been abandoned since 2019 with no active maintenance. It supports Python 2.7 and Python 3.4 and later, but has not been updated to track changes in pytest or Python's evolution. If you need phase-level timeout control on Linux and can accept the risk of an unmaintained dependency, it may still work; otherwise, consider whether a more actively maintained timeout solution fits your needs.
Use it for:
- Enforce maximum duration for test setup operations (database connections, fixture initialization) separately from the test body.
- Catch tests that hang during teardown (resource cleanup) without timing out the actual test execution.
- Set different timeout thresholds for slow integration tests versus fast unit tests using pytest markers.
- Debug test hangs by disabling timeouts when running under PDB without removing timeout configuration.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pytest plugin that enforces separate timeout limits on the setup, execution, and teardown phases of individual tests using SIGALRM signals on Linux.
No, unless you have a specific Linux-only use case that requires phase-level timeout control and can tolerate an unmaintained package. The plugin has not been updated since 2019, and there is no active maintenance or security support. For most projects, a maintained timeout plugin or pytest's built-in timeout mechanisms are safer choices.
Install
pytest-timeouts on PyPI
pip
pip install pytest-timeoutsuv
uv add pytest-timeoutspoetry
poetry add pytest-timeoutsInstalling pytest-timeouts
Before you install
High install friction: the package is abandoned (last commit 2019-12-30, 2519 days ago) and has not been updated since its 1.2.1 release in 2019-09-21. No active maintenance or security updates are available.
License in practice
MIT license is permissive and poses no redistribution restrictions, but the abandoned maintenance status means no license updates or clarifications will be forthcoming.
Quickstart
pip install pytest-timeouts
# In pytest.ini:
[pytest]
setup_timeout = 2.5
execution_timeout = 2.01
teardown_timeout = 0
# Or via command line:
pytest --setup-timeout 2.5 --execution-timeout 2.01 --teardown-timeout 0
Linux only; uses SIGALRM signal which is not available on Windows or macOS. Requires Python 2.7 or Python 3.4+.
Verify before relying
- Whether the plugin works reliably with modern pytest versions (last tested in 2019)
- Compatibility with current Python 3.x minor versions beyond what the classifier states
- Whether SIGALRM-based timeout handling conflicts with async test frameworks or other signal-using libraries
Package facts
| License | MIT license (permissive) |
| Python support | supports the current Python release (>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*) |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 2,519 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,718,049/month — #2,517 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest-timeouts-1.2.1.tar.gz
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytest-timeoutAborts pytest tests that exceed a specified…
permissive · top 1,000 on PyPI
pytest-durationsA pytest plugin that measures and reports…
permissive · top 5,000 on PyPI
pytest-extra-durationsA pytest plugin that reports test execution…
permissive · top 15,000 on PyPI
pytest-fail-slowA pytest plugin that marks tests as failed if…
permissive · top 15,000 on PyPI
pytest-retrypytest-retry is a pytest plugin that…
permissive · top 5,000 on PyPI
pytest-timerPytest plugin that measures and reports the…
permissive · top 15,000 on PyPI
pytest-asyncio-concurrentA pytest plugin that executes async test…
permissive · top 15,000 on PyPI
pysigsetProvides Python access to POSIX signal masking…
copyleft · top 15,000 on PyPI
pytest-item-dictA pytest plugin that builds hierarchical…
unclear · top 15,000 on PyPI
iteratorsWraps Python iterators to add timeout behavior,…
permissive · top 15,000 on PyPI