skillfed

pytest-timeouts

Linux-only Pytest plugin to control durations of various test case execution phases

pytest-timeouts v1.2.1 3.7M downloads/30d#2,517 on PyPI12
Permissive license MIT license Abandoned released

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-timeouts

uv

uv add pytest-timeouts

poetry

poetry add pytest-timeouts

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleEnvironment :: PluginsIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3Topic :: Software Development :: TestingTopic :: Utilities

Tags

pytest phase timeout controltest setup execution teardown timeoutlinux pytest signal alarmper-phase test duration limitspytest test lifecycle timeout
linux-onlyabandoned

More Utilities packages