Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koaning/pytest-duration-insights
A mini dashboard to help find slow tests in pytest.
https://github.com/koaning/pytest-duration-insights
Last synced: about 4 hours ago
JSON representation
A mini dashboard to help find slow tests in pytest.
- Host: GitHub
- URL: https://github.com/koaning/pytest-duration-insights
- Owner: koaning
- Created: 2021-02-27T18:08:21.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-15T09:56:52.000Z (5 months ago)
- Last Synced: 2024-12-09T17:57:09.419Z (5 days ago)
- Language: Python
- Homepage: https://koaning.github.io/pytest-duration-insights/
- Size: 2.91 MB
- Stars: 78
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
- awesome-pytest - pytest-duration-insights - Gives an interactive dashboard to show where the slow tests are. (Plugins)
README
### Pytest Duration Insights
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](https://github.com/pytest-dev/pytest-reportlog).## Preview
We're hosting a demo on GitHub pages. You can view it
[here](https://koaning.github.io/pytest-duration-insights/). There's also an educational
video announcement on [calmcode.io](https://calmcode.io) found [here](https://calmcode.io/labs/pytest-duration-insights.html).![](gif.gif)
## Instructions.
### 1. Install.
```
pip install pytest-reportlog pytest-duration-insights
```### 2. Make a report.
```
pytest --report-log reportlog.jsonl
```### 3. Explore!
```
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.#### Parametrized Tests
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.
![](https://user-images.githubusercontent.com/98330/147872375-cb3e1bc9-2c3e-4b8f-9abc-0ec236e55f96.png)
## Roadmap
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.