Skip to main content

Pytest plugin to reverse test order.

Project description

https://github.com/adamchainz/pytest-reverse/workflows/CI/badge.svg?branch=master https://img.shields.io/pypi/v/pytest-reverse.svg https://img.shields.io/badge/code%20style-black-000000.svg

Pytest plugin to reverse test order.

Usage

Install from pip with:

python -m pip install pytest-reverse

Python 3.5 to 3.8 supported.

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.

History

1.0.0 (2020-04-03)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-reverse-1.0.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_reverse-1.0.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest-reverse-1.0.0.tar.gz.

File metadata

  • Download URL: pytest-reverse-1.0.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for pytest-reverse-1.0.0.tar.gz
Algorithm Hash digest
SHA256 10bbd495b2144040fbf37e58e3537e8c6a4bad4e1d03a317eec010c36c5fd1c8
MD5 293c65bacd77b0aaaff92b276727ad6a
BLAKE2b-256 87e7a949f686f94b10a38a23853abb6ee197a02a03601954da0fe988a8ac5ce6

See more details on using hashes here.

File details

Details for the file pytest_reverse-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_reverse-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for pytest_reverse-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e88b461bb3f419c01a0fc6cea3fdd8dd8b86e6978e640c2116e7462a367e482
MD5 0036610c3ac82190c479f89e8a3c59c2
BLAKE2b-256 afc37ff55aa3a7c98da0246d58af58e109f44bea2792471ff1128f375e910e7e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page