$npx skillfedfor your agent

pytest-timeout

pytest plugin to abort hanging tests

Worth itPyPI TestingReleased May 2025103.1M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_timeout-2.4.0-py3-none-any.whl
v2.4.0 · released 2025-05-05 · Python >=3.7 · 1 runtime deps: pytest

Yes. This is a mature, actively maintained plugin (Production/Stable status, last release 2025-05-05) with no known vulnerabilities and low install friction. It solves a real problem—detecting hanging tests in CI—and is widely used (top 1000 PyPI packages). Install it if you run tests in environments where manual intervention is impractical; skip it if your test suite is already fast and you have other mechanisms to catch hangs.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Timeout termination method (signal vs.
  • thread) is platform-dependent; signal method may interfere with code under test that uses SIGALRM, and thread method will skip teardown and JUnit XML output.
  • Low friction—a pure Python wheel with only pytest as a runtime dependency.

License · maintenance · safety

MIT (permissive) — MIT license (permissive); you can use, modify, and distribute this plugin freely in commercial and private projects with minimal restrictions.

last release 2025-05-05 (466 days) · last repo commit 2026-06-30 · 255 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 103,142,767 downloads/mo, #334 on PyPI

Verify before relying

pip install pytest-timeout

# In your test file:
import pytest

@pytest.mark.timeout(60)
def test_foo():
    pass

# Or run with a global timeout:
# pytest --timeout=300
  • Whether the plugin's overhead is acceptable for test suites with many short tests.
  • Compatibility with specific test frameworks or fixtures beyond pytest's standard model.
Same gist for agents: .md · .json

What it is and what it does

pytest-timeout is a pytest plugin that enforces time limits on individual tests to catch hanging or deadlocked tests. It terminates tests that exceed a configured duration and dumps the stack of all running threads to stderr for debugging. The plugin supports both a global timeout (set via command line, environment variable, or config file) and per-test overrides using the @pytest.mark.timeout decorator.

The plugin offers two termination methods: signal (graceful on POSIX, allows test run to continue) and thread (more portable, terminates the whole process). The signal method is the default on systems that support SIGALRM; thread is the fallback. The documentation explicitly warns that this is a last-resort tool for catching excessively long test durations, not a replacement for writing fast tests or measuring performance regressions.

Use it for

  • Catch deadlocked or hanging tests in continuous integration pipelines where manual intervention is not possible.
  • Debug test suite hangs by examining stack dumps of all threads printed to stderr when a timeout fires.
  • Set per-test timeouts for known slow operations while maintaining a global timeout for the rest of the suite.
  • Prevent a single hanging test from blocking the entire test run in CI environments.
  • Identify tests that have become unexpectedly slow due to code changes or environment issues.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

This is a mature, actively maintained plugin (Production/Stable status, last release 2025-05-05) with no known vulnerabilities and low install friction. It solves a real problem—detecting hanging tests in CI—and is widely used (top 1000 PyPI packages). Install it if you run tests in environments where manual intervention is impractical; skip it if your test suite is already fast and you have other mechanisms to catch hangs.

Install

pytest-timeout on PyPI

Before you install

Low friction—a pure Python wheel with only pytest as a runtime dependency. Actively maintained with recent releases; last commit 2026-06-30 and 255 GitHub stars indicate steady use.

Timeout termination method (signal vs. thread) is platform-dependent; signal method may interfere with code under test that uses SIGALRM, and thread method will skip teardown and JUnit XML output.

License in practice

MIT license (permissive); you can use, modify, and distribute this plugin freely in commercial and private projects with minimal restrictions.

Quickstart

pip install pytest-timeout

# In your test file:
import pytest

@pytest.mark.timeout(60)
def test_foo():
    pass

# Or run with a global timeout:
# pytest --timeout=300

Verify before relying

  • Whether the plugin's overhead is acceptable for test suites with many short tests.
  • Compatibility with specific test frameworks or fixtures beyond pytest's standard model.

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.7
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pytest
MaintenanceActively maintained 466 days since the last release
Last repo commit
First released
Downloads103,142,767 / month, #334 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: PluginsFramework :: PytestIntended Audience :: DevelopersLicense :: DFSG approvedLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Evidence: pytest_timeout-2.4.0-py3-none-any.whl

Tags

Capabilities
pytest test timeoutabort hanging teststest execution timeoutpytest timeout plugindetect deadlocked teststest duration limitpytest hanging test detection
Topics
pytest-pluginci-testingtest-diagnostics

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “abort hanging tests”

  • pytest-timeoutAborts pytest tests that exceed a specified time limit, with stack…
  • pytest-operatorA pytest plugin that provides fixtures and helpers for writing…
  • transactionProvides a generic transaction management system for Python, handling…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also pytest-fail-slow · pytest-socket · pytest-timeouts · stopit · interruptingcow · pytest-run-parallel · func-timeout · pytest_tagging · pytest-extra-durations · wrapt-timeout-decorator