WiredNerd / pytest-sort

Tools for sorting pytest test cases

Home Page:https://pytest-sort.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Homepage python>=3.8 PyPI - Version PyPI - Downloads PyPI - License

Code Coverage Mutation Coverage Documentation

Imports: isort Code Style: black Linter: ruff Snyk Security

Pytest-Sort

This pytest plugin is used to help identify application state leaks in your test suite. It does this by automatically changing the execution order of test cases.

How frustrating is it to have a test case that works fine when runs by itself, but fails when run with the rest of the suite? By running tests in a random order, the culprit of such problems can be identified much earlier in the development process. Alternately, running in ordered and reverse order can help find the cause of the problem in existing test suites.

Features

  • Multiple sort options including: Random, Fastest, Reverse, and more.
  • Group test cases into buckets that are each sorted separately.
  • Control sort order of the buckets.
  • Use Pytest markers to always run specific test cases in order.

Quick Start

Installation:

pip install pytest-sort --upgrade

Running with pytest-sort:

pytest --sort-mode=random

Documentation:

Contribute

Support

If you are having issues, please let us know.

I can be contacted at: pbuschmail-pytestsort@yahoo.com

Or by opening an issue: https://github.com/WiredNerd/pytest-sort/issues

License

The project is licensed under the MIT license.

About

Tools for sorting pytest test cases

https://pytest-sort.readthedocs.io/

License:MIT License


Languages

Language:Python 94.0%Language:Jupyter Notebook 6.0%