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:
- Usage, Examples, Configuration, and more: https://pytest-sort.readthedocs.io/
Contribute
- Issue Tracker: https://github.com/WiredNerd/pytest-sort/issues
- Source Code: https://github.com/WiredNerd/pytest-sort
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.
Metadata
Release files for pytest-sort 1.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_sort-1.3.3.tar.gz | 26.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_sort-1.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.0 kB
Release files / pytest_sort-1.3.3.tar.gz
| Download URL | pytest_sort-1.3.3.tar.gz |
|---|---|
| Size | 26.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
782cdcc0dca7a52dd3ca28d90e110cfc6b4d54a3d0dc767c55588cc7efbabdf3
|
|
BLAKE2b-256 checksum How to use checksums |
429f4e07dae01d5b8d2f13ca59d4fd0007e3ae586ff19b4e1a25e8dc60089f8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 4, 2026.
Transparency logRelease files / pytest_sort-1.3.3-py3-none-any.whl
| Download URL | pytest_sort-1.3.3-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
03b51ad46515d7e33d9c5a4039b99e69be25e9c8f810dbda8caf3555373c7644
|
|
BLAKE2b-256 checksum How to use checksums |
3acfd2aec7a764384d1d052275112c6b17d395c0db807c77c354d5be9ee2f515
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 4, 2026.
Transparency log