All Projects → adamchainz → pytest-reverse

adamchainz / pytest-reverse

Licence: MIT license
Pytest plugin to reverse test order.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to pytest-reverse

Cookiecutter Pytest Plugin
A Cookiecutter template for pytest plugins 💻
Stars: ✭ 181 (+805%)
Mutual labels:  pytest
Best Of Python Dev
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.
Stars: ✭ 243 (+1115%)
Mutual labels:  pytest
web-ui
python+selenium+pytest+allure UI 自动化框架
Stars: ✭ 199 (+895%)
Mutual labels:  pytest
Pytest Chinese Doc
pytest 官方文档的中文翻译,但不仅仅是单纯的翻译,也包含自己的理解和实践。
Stars: ✭ 192 (+860%)
Mutual labels:  pytest
Httprunner
One-stop solution for HTTP(S) testing, written in Python.
Stars: ✭ 2,628 (+13040%)
Mutual labels:  pytest
agent-python-pytest
Framework integration with PyTest
Stars: ✭ 86 (+330%)
Mutual labels:  pytest
Pytest Lazy Fixture
It helps to use fixtures in pytest.mark.parametrize
Stars: ✭ 179 (+795%)
Mutual labels:  pytest
pylint-pytest
A Pylint plugin to suppress pytest-related false positives.
Stars: ✭ 2 (-90%)
Mutual labels:  pytest
Pytest Selenium
Plugin for running Selenium with pytest
Stars: ✭ 246 (+1130%)
Mutual labels:  pytest
pytest-neo
Matrix has you...
Stars: ✭ 44 (+120%)
Mutual labels:  pytest
Cookiecutter Cms
Python-centric Cookiecutter for Molecular Computational Chemistry Packages
Stars: ✭ 197 (+885%)
Mutual labels:  pytest
Pytest Qt
pytest plugin for Qt (PyQt4, PyQt5 and PySide) application testing
Stars: ✭ 210 (+950%)
Mutual labels:  pytest
stock reminder bot
A twitter bot that reminds you of stock and crypto predictions
Stars: ✭ 25 (+25%)
Mutual labels:  pytest
Django Test Migrations
Test django schema and data migrations, including migrations' order and best practices.
Stars: ✭ 188 (+840%)
Mutual labels:  pytest
Semantic-Textual-Similarity
Natural Language Processing using NLTK and Spacy
Stars: ✭ 30 (+50%)
Mutual labels:  pytest
Seleniumbase
A Python framework that inspires developers to become better test automation engineers. 🧠💡
Stars: ✭ 2,520 (+12500%)
Mutual labels:  pytest
ci-testing-python
Sample Microservice App in Python for Testing using pytest, uber/doubles, tox on CI servers like Jenkins and Travis CI using Docker + Docker-Compose for test environment.
Stars: ✭ 37 (+85%)
Mutual labels:  pytest
pytest-kind
Mirror of pytest-kind: Test your Python Kubernetes app/operator end-to-end with kind and pytest
Stars: ✭ 16 (-20%)
Mutual labels:  pytest
overhave
Web-framework for BDD: scalable, configurable, easy to use, based on Flask Admin and Pydantic.
Stars: ✭ 61 (+205%)
Mutual labels:  pytest
pytest-playwright
Pytest plugin to write Playwright tests with ease. Provides fixtures to have a page instance for each individual test and helpful CLI options for headless browsers.
Stars: ✭ 14 (-30%)
Mutual labels:  pytest

pytest-reverse

https://img.shields.io/github/actions/workflow/status/adamchainz/pytest-reverse/main.yml?branch=main&style=for-the-badge https://img.shields.io/pypi/v/pytest-reverse.svg?style=for-the-badge https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge pre-commit

Pytest plugin to reverse test order.

Installation

Install with:

python -m pip install pytest-reverse

Python 3.7 to 3.11 supported.


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!


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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].