Linux-only Pytest plugin to control durations of various test case execution phases
Project Links
Meta
Author: Pawel Lampe
Requires Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
Classifiers
Development Status
- 5 - Production/Stable
Environment
- Console
- Plugins
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Operating System
- Unix
- POSIX
Programming Language
- Python
- Python :: 2.7
- Python :: 3
Topic
- Software Development :: Testing
- Utilities
pytest-timeouts
Linux-only Pytest plugin to control durations of various test case execution phases.
Documentation
For documentation visit pytest-timeouts.readthedocs.io.
About
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.
Features
setup,executionandteardownphase timeouts controllable by:- opts:
--setup-timeout,--execution-timeoutand--teardown-timeout - ini:
setup_timeout,execution_timeoutandteardown_timeout - mark:
setup_timeout,execution_timeoutandteardown_timeout
- opts:
- fixed order of timeout settings: opts > markers > ini, controlled by
--timeouts-order --timeouts-orderallow change order of override timeout settings, and disable some settings, i.e.--timeout-order idisable markers and opts, any combination is allow- timeout disabled when debugging with PDB
Installation
Stable
pip install pytest-timeouts
Master
pip install git+https://github.com/Scony/pytest-timeouts.git
Usage
Command line
pytest --setup-timeout 2.5 --execution-timeout 2.01 --teardown-timeout 0
pytest.ini setting
[pytest]
setup_timeout = 2.5
execution_timeout = 2.01
teardown_timeout = 0
Mark
import time
import pytest
@pytest.mark.setup_timeout(0.3)
@pytest.mark.execution_timeout(0.5)
@pytest.mark.teardown_timeout(0.4)
def test_timeout():
time.sleep(1)
Contributors
- Pawel Lampe
- Kamil Luczak
1.2.1
Sep 21, 2019
1.2
May 01, 2019
1.1.2
Dec 26, 2018
1.1.1
Dec 22, 2018
1.1.0
Jul 12, 2018
1.0.0
Jul 11, 2018
Files in release
No dependencies