A simple plugin to first execute tests that historically failed more
This pytest plugin was generated with cookiecutter along with @hackebrot's cookiecutter-pytest-plugin template.
This plugin will save a history of your tests executions in a file .test_history. For each test it will have how many times it was executed, and how many times it failed.
Using that information it will calculate the percentage of failure of tests, and order them to first execute the higher failure ratio
- Python>=3
You can install "pytest-sorter" via pip from PyPI:
$ pip install pytest-sorter
After installed, your tests will automatically create and update the .test_history file, and order tests by their failure ratio.
You can tell pytest to ignore this plugin by passing:
`
pytest --no-sorted
`
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the MIT license, "pytest-sorter" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.