--- id: pytest-durations version: "1.9.0" license: MIT license_treatment: permissive maintenance: active --- # pytest-durations — Pytest plugin reporting fixtures and test functions execution time. License: permissive · Maintenance: active · Downloads: 3.5M/mo ## What it is and what it does pytest-durations is a pytest plugin that breaks down test execution time into separate measurements for fixtures, test setup, test calls, and teardown phases. Unlike pytest's built-in --durations flag, it isolates fixture durations from test function durations and accounts for fixtures with scope larger than "function" by subtracting their time from the test duration, giving you a clearer picture of what's actually slow in your test suite. The plugin integrates directly into pytest and offers granular reporting options: you can filter which sections to display (fixture, call, setup, teardown), choose how to group results (by module, class, or function), select which statistics to show (total, num, min, med, max, and percentiles p90/p95/p99), and export results as JSON for CI integration. It works with pytest-xdist for distributed testing and handles time-traveling packages like freezegun. Use it for: - Identify slow fixtures that are blocking your test suite and prioritize optimization efforts. - Compare test performance across modules or classes to find which parts of your codebase have the slowest tests. - Export timing data as JSON to track test performance trends over time in CI/CD pipelines. - Debug test setup and teardown overhead separately from the actual test logic execution time. - Use percentile columns to understand the distribution of test durations rather than just min/max values. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that measures and reports fixture and test function execution times separately, with support for xdist and time-traveling packages. Yes. This is a lightweight, actively maintained plugin with no security vulnerabilities, permissive licensing, and a single stable dependency. Install it if you need finer-grained visibility into test performance than pytest's built-in --durations provides, especially for large test suites where fixture overhead is significant. ## Install pip install pytest-durations uv add pytest-durations poetry add pytest-durations ## Installing pytest-durations Before you install: Low friction: pure Python wheel with only pytest as a runtime dependency. Actively maintained with a release on 2026-08-14 and 44 repository stars. License in practice: MIT license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install pytest-durations pytest --pytest-durations=10 # Shows fixture and test durations separately in the report Requires Python 3.10 or later (supports up to 3.14). Verify before relying: - Whether the plugin's percentile columns (p90, p95, p99) are available in all output formats or only in specific configurations. - Performance overhead of the plugin on very large test suites with thousands of tests. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest test duration measurement, fixture execution time profiling, pytest performance reporting, test timing analysis, pytest slowest tests, fixture duration tracking, test setup teardown timing, pytest-plugin, performance-profiling, ci-integration [View on SkillFed](https://skillfed.io/packages/pytest-durations) · [View on PyPI](https://pypi.org/project/pytest-durations/)