This python package offers a small dashboard that helps you investigate long running pytest runs. It's built on top of the report that is generated by pytest-reportlog.
We're hosting a demo on GitHub pages. You can view it here. There's also an educational video announcement on calmcode.io found here.
pip install pytest-reportlog pytest-duration-insights
pytest --report-log reportlog.jsonl
pytest-duration-insights explore reportlog.jsonl
This will start up a service that tries to help you find areas in your testing code base that are worth investigating.
This tool automatically hides the parametrized test results. But if these
are very important to you then you can turn them on via the --no-trim
flag.
pytest-duration-insights explore --no-trim reportlog.jsonl
Be aware that you might get very dense visuals when you do this.
We're only scratching the surface of what data we can visualise to help
you speed up your pytest
runs. Feedback is appreciated,
especially if somebody has a keen insight that has helped in the past.
That said, this project is very much an experiment as well. See it as a tool you could try rather than a best practice.