Skip to main content

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

Project description


Build Status Documentation Status PyPI PyPI - License GitHub Release Date Supported pytest>=3.1

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


For documentation visit


This plugin has been designed for specific use cases which are out of the scope of famous pytest-timeout plugin. It uses a SIGALRM signal to schedule a timer which breaks the test case.


  • setup, execution and teardown phase timeouts controllable by:
    • opts: --setup-timeout, --execution-timeout and --teardown-timeout
    • ini: setup_timeout, execution_timeout and teardown_timeout
    • mark: setup_timeout, execution_timeout and teardown_timeout
  • fixed order of timeout settings: opts > markers > ini, controlled by --timeouts-order
  • --timeouts-order allow change order of override timeout settings, and disable some settings, i.e. --timeout-order i disable markers and opts, any combination is allow
  • timeout disabled when debugging with PDB



pip install pytest-timeouts


pip install git+



pytest --setup-timeout 2.5 --execution-timeout 2.01  --teardown-timeout 0

pytest.ini setting

setup_timeout = 2.5
execution-timeout = 2.01
teardown-timeout = 0


import time

import pytest

def test_timeout():


  • Pawel Lampe
  • Kamil Luczak

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pytest-timeouts-1.1.2.tar.gz (4.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page