skillfed

pytest-timer

A timer plugin for pytest

pytest-timer v1.0.0 94.8K downloads/30d#13,302 on PyPI15
Permissive license MIT DORMANT released

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

uv

uv add pytest-timer

poetry

poetry add pytest-timer

Installing 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

Environment :: ConsoleFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Testing

Tags

pytest test timingmeasure test durationslowest tests reportpytest performance profilingtest execution time tracking
pytest-plugintest-profiling

More Testing packages