Pytest plugin to reverse test order.
Project description
Pytest plugin to reverse test order.
Testing a Django project? Check out my book Speed Up Your Django Tests which covers loads of recommendations to write faster, more accurate tests. I created pytest-reverse whilst working on the book!
Installation
Install with:
python -m pip install pytest-reverse
Python 3.9 to 3.14 supported.
Usage
Pytest will automatically find the plugin and use it when you run pytest. You can reverse test order by passing the --reverse flag:
pytest --reverse
You can make this always apply by adding it to the addopts setting in your pytest.ini (or other configuration file):
[pytest]
addopts = --reverse
History
I’m the creator and maintainer of pytest-randomly, a plugin for randomly ordering tests. @thbde opened an issue there pointing to the paper Empirically revisiting the test independence assumption, which covers test reordering techniques. It turns out that reversal is nearly as effective as randomization.
Test reversal is available in Django’s test runner. I figured such an option or plugin would exist for pytest already, but it didn’t, so I made it here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_reverse-1.9.0.tar.gz.
File metadata
- Download URL: pytest_reverse-1.9.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3b756f13bfc5b9aa39bfc57d2d5e03ec62f7fdfed2c04cad664c283d63ce94a
|
|
| MD5 |
0c3c4b1216283fb2c9a010232e073095
|
|
| BLAKE2b-256 |
d05f9f3227f0c1ae1411fa5921af8f9cb88ac71f988750ab0bc27f4a29179a64
|
Provenance
The following attestation bundles were made for pytest_reverse-1.9.0.tar.gz:
Publisher:
main.yml on adamchainz/pytest-reverse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_reverse-1.9.0.tar.gz -
Subject digest:
a3b756f13bfc5b9aa39bfc57d2d5e03ec62f7fdfed2c04cad664c283d63ce94a - Sigstore transparency entry: 487785209
- Sigstore integration time:
-
Permalink:
adamchainz/pytest-reverse@ed067bdc4989917e353fee1edfce257e6c513c7f -
Branch / Tag:
refs/tags/1.9.0 - Owner: https://github.com/adamchainz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@ed067bdc4989917e353fee1edfce257e6c513c7f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_reverse-1.9.0-py3-none-any.whl.
File metadata
- Download URL: pytest_reverse-1.9.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cb9cb2403eea2f953fd6b9629637387cf6e75594f8573738f68ec1aca11dcd1
|
|
| MD5 |
56671883263db1d3291369a4c860b73a
|
|
| BLAKE2b-256 |
291c126e8d934e8852c89fb898f77512050c0c34cf96f195f02cbd36c5dd0356
|
Provenance
The following attestation bundles were made for pytest_reverse-1.9.0-py3-none-any.whl:
Publisher:
main.yml on adamchainz/pytest-reverse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_reverse-1.9.0-py3-none-any.whl -
Subject digest:
3cb9cb2403eea2f953fd6b9629637387cf6e75594f8573738f68ec1aca11dcd1 - Sigstore transparency entry: 487785236
- Sigstore integration time:
-
Permalink:
adamchainz/pytest-reverse@ed067bdc4989917e353fee1edfce257e6c513c7f -
Branch / Tag:
refs/tags/1.9.0 - Owner: https://github.com/adamchainz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@ed067bdc4989917e353fee1edfce257e6c513c7f -
Trigger Event:
push
-
Statement type: