pytest-timeout
pytest plugin to abort hanging tests
Install
pytest-timeout on PyPI
pip
pip install pytest-timeoutuv
uv add pytest-timeoutpoetry
poetry add pytest-timeoutPackage facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | actively maintained — 465 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pytest_timeout-2.4.0-py3-none-any.whl
About pytest-timeout
from the package's own PyPI description — quoted content, verbatim
============== pytest-timeout ==============
|python| |version| |anaconda| |ci| |pre-commit|
.. |version| image:: https://img.shields.io/pypi/v/pytest-timeout.svg :target: https://pypi.python.org/pypi/pytest-timeout
.. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-timeout.svg :target: https://anaconda.org/conda-forge/pytest-timeout
.. |ci| image:: https://github.com/pytest-dev/pytest-timeout/workflows/build/badge.svg :target: https://github.com/pytest-dev/pytest-timeout/actions
.. |python| image:: https://img.shields.io/pypi/pyversions/pytest-timeout.svg :target: https://pypi.python.org/pypi/pytest-timeout/
.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest-timeout/master.svg :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest-timeout/master
.. warning::
Please read this README carefully and only use this plugin if you understand the consequences. This plugin is designed to catch excessively long test durations like deadlocked or hanging tests, it is not designed for precise timings or performance regressions. Remember your test suite should aim to be fast, with...
Read as markdown · JSON record · Source repository · Homepage
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
A pytest plugin that terminates tests exceeding a specified duration, useful for catching hanging or deadlocked tests during continuous integration or local test runs.
Low friction install with a single lightweight runtime dependency on pytest. The package is actively maintained with recent releases and has been stable since 2012, with no known vulnerabilities.
MIT license (permissive) allows free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and proprietary projects.
Usage
pip install pytest-timeout
pytest --timeout=300
# Or per-test via decorator:
import pytest
@pytest.mark.timeout(60)
def test_foo():
pass
Requires Python 3.7 or higher. On POSIX systems, the signal method (default) may interfere with code under test that uses SIGALRM; use the thread method as fallback.
Verdict: A mature, well-maintained pytest plugin with no security issues and permissive licensing. Install is straightforward. Best suited as a safety net for detecting hung tests rather than for precise performance measurement; read the documentation carefully to understand termination behavior on your platform.
Needs verification
- Whether the thread termination method's overhead is acceptable for large test suites
- Compatibility with other pytest plugins that manipulate process signals or threading
Similar packages
permissive · top 1,000 on PyPI
pytest-rerunfailurescopyleft · top 1,000 on PyPI
pytest-metadatacopyleft · top 1,000 on PyPI
pytestpermissive · top 100 on PyPI
multitaskingpermissive · top 1,000 on PyPI
pytest-mockpermissive · top 1,000 on PyPI
pytest-httpxpermissive · top 1,000 on PyPI
pypermissive · top 1,000 on PyPI
pytest-asynciopermissive · top 1,000 on PyPI
llama-cloudpermissive · top 1,000 on PyPI