pytest-extra-durations

raw JSON →
0.1.3 verified Fri May 01 auth: no python maintenance

A pytest plugin that reports aggregated test durations per function, per module, and total. Current version 0.1.3 (last release 2019-05-17). Low maintenance, stable for Python 3.5+.

pip install pytest-extra-durations
error usage: pytest [options] [file_or_dir] ... pytest: error: unrecognized arguments: --durations-extra
cause Plugin not installed correctly or not activated.
fix
Ensure pytest-extra-durations is installed in the same environment: pip install pytest-extra-durations
error AttributeError: module 'pytest' has no attribute 'hookimpl'
cause Plugin is incompatible with pytest version (e.g., pytest 7+ changed hook registration).
fix
Downgrade pytest to version <=6 or use a compatible alternative.
gotcha The --durations-extra flag is NOT a builtin pytest flag; you must install pytest-extra-durations for it to work. Running pytest --durations-extra without the plugin results in an 'unrecognized arguments' error.
fix pip install pytest-extra-durations
gotcha The plugin reports durations only after the entire test suite finishes, not per-test during execution. This may confuse users expecting real-time reporting.
fix Wait for test completion to see extra duration summaries.
deprecated No new releases since 2019; compatible with pytest <7. May not work with modern pytest versions due to internal API changes (e.g., pytest 7+).
fix Consider forking or using alternative plugins like pytest-timeout or pytest-benchmark.

Install and run with --durations-extra flag to see aggregated durations.

# No special import needed; enable with --durations-extra
# Run tests with extra duration summaries:
# pytest --durations-extra