Skip to content

AndreMicheletti/pytest-sorter

Repository files navigation

pytest-sorter

See Build Status on Travis CI

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.

Description

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

Requirements

  • Python>=3

Installation

You can install "pytest-sorter" via pip from PyPI:

$ pip install pytest-sorter

Usage

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 `

Contributing

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.

License

Distributed under the terms of the MIT license, "pytest-sorter" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

About

Pytest plugin to sort tests by their failure ratio (published to pypi)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published