--- id: pytest-reverse version: "1.9.0" license: MIT license_treatment: permissive maintenance: active --- # pytest-reverse — Pytest plugin to reverse test order. License: permissive · Maintenance: active · Downloads: 75.0K/mo ## What it is and what it does pytest-reverse is a pytest plugin that reverses the order in which tests are executed. It works by adding a --reverse flag to pytest, allowing you to run your test suite backwards instead of in the default or randomized order. The plugin is automatically discovered by pytest once installed. Test reversal helps identify tests that depend on execution order or shared state—a common source of flaky tests and false positives. By running tests in reverse, you can detect whether a passing test only passes because an earlier test set up some state, or whether a test fails only when preceded by a specific other test. This is a lightweight alternative to full randomization for uncovering test isolation issues. Use it for: - Run your test suite backwards to catch tests that pass only due to side effects from earlier tests. - Debug flaky tests by checking if they fail when executed in reverse order. - Add --reverse to pytest.ini to make reverse execution the default for your project. - Verify test independence before committing code that modifies test fixtures or setup. - Complement randomized testing strategies with a deterministic reverse run. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that runs tests in reverse order to detect test interdependencies and ordering issues. Yes. Low install friction, no security issues, actively maintained, and a focused tool that solves a real problem in test reliability. Useful for any project where test ordering might mask failures or dependencies. ## Install pip install pytest-reverse uv add pytest-reverse poetry add pytest-reverse ## Installing pytest-reverse Before you install: Low friction: pure Python wheel with only pytest as a runtime dependency. Actively maintained with recent releases; last commit 2026-08-13. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal obligations. Quickstart: pip install pytest-reverse pytest --reverse Requires Python 3.9 or later. Verify before relying: - Whether test reversal alone is sufficient to catch all ordering-dependent failures or if it works best combined with other techniques. - Performance impact when reversing large test suites. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 75.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest reverse test order, test execution order, detect test dependencies, pytest plugin ordering, reverse test sequence, test isolation verification, pytest test reordering, test-isolation, pytest-plugin [View on SkillFed](https://skillfed.io/packages/pytest-reverse) · [View on PyPI](https://pypi.org/project/pytest-reverse/)