A pytest plugin that reverses the order of test execution. Useful for detecting tests that accidentally depend on order or for randomization. Current version 1.9.0, compatible with Python >=3.9.
pip install pytest-reverseNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Use --reverse flag to reverse entire test session, or @pytest.mark.reverse() marker to reverse only specific tests.
To reverse test file order, use pytest --reverse --co (with pytest-order plugin) or sort test files manually.
Apply marker to each test function you want reversed, or use --reverse for global reversal.
Use @pytest.mark.reverse() with parentheses.