pytest-timer
A timer plugin for pytest
What it is and what it does
pytest-timer is a pytest plugin that automatically measures and displays the execution time of each test as part of the test report. It was ported from the nose-timer plugin for the older nose test runner. After running tests, it appends a summary section showing test names, their status, and duration in seconds.
The plugin integrates directly into pytest's reporting pipeline with no configuration required beyond installation. It supports filtering to show only the slowest tests (via --timer-top-n), disabling colored output for headless environments (--timer-no-color), and filtering results by status color (--timer-filter). Optional dependencies on termcolor or colorama enable colored duration output.
Use it for:
- Identify slow tests in a suite to prioritize optimization efforts.
- Monitor test performance regressions across commits by comparing duration reports.
- Debug flaky tests by observing variance in execution time across runs.
- Generate timing reports in CI/CD pipelines to track test suite health over time.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pytest plugin that measures and reports the execution time of individual tests, with options to filter by duration and disable colored output.
Yes, if you need basic test timing visibility and accept dormant maintenance. The plugin is simple, has no security vulnerabilities, and low install friction. However, if you need active bug fixes, advanced profiling features, or support for newer pytest versions beyond 3.12, consider whether the lack of recent updates poses a risk for your project.
Install
pytest-timer on PyPI
pip
pip install pytest-timeruv
uv add pytest-timerpoetry
poetry add pytest-timerInstalling pytest-timer
Before you install
Low friction install as a pure-Python wheel with only pytest as a runtime dependency. Maintenance is dormant—last release was 2023-12-26 and no commits since 2024-09-03—but the repository remains active and the package is stable enough for basic timing use.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install pytest-timer
pytest --timer-top-n 10
Verify before relying
- Whether colored output (termcolor/colorama extras) works reliably on modern terminal emulators.
- Whether the plugin handles async tests or parametrized tests correctly.
- Performance impact when running large test suites with hundreds or thousands of tests.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | dormant — 962 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 94,800/month — #13,302 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytest_timer-1.0.0-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
pytest-durationsA pytest plugin that measures and reports…
permissive · top 5,000 on PyPI
pytest-extra-durationsA pytest plugin that reports test execution…
permissive · top 15,000 on PyPI
django-slowtestsIntegrates with Django's test runner to…
permissive · top 15,000 on PyPI
pytest-timeoutsA pytest plugin that enforces separate timeout…
permissive · top 5,000 on PyPI
stopwatch.pyProvides a simple stopwatch timer that measures…
permissive · top 15,000 on PyPI
pytest-timeoutAborts pytest tests that exceed a specified…
permissive · top 1,000 on PyPI
pytest-clarityA pytest plugin that displays colored,…
permissive · top 15,000 on PyPI
xdoctestXdoctest finds and executes test code embedded…
permissive · top 5,000 on PyPI
pytest-splitA pytest plugin that divides a test suite into…
permissive · top 5,000 on PyPI
types-termcolorProvides type stubs for the termcolor package,…
permissive · top 15,000 on PyPI