{"id":13772087,"url":"https://github.com/adamchainz/pytest-reverse","last_synced_at":"2025-12-30T01:02:56.586Z","repository":{"id":37941146,"uuid":"252816746","full_name":"adamchainz/pytest-reverse","owner":"adamchainz","description":"Pytest plugin to reverse test order.","archived":false,"fork":false,"pushed_at":"2025-05-05T17:48:11.000Z","size":411,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T18:59:36.300Z","etag":null,"topics":["pytest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamchainz.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://adamj.eu/books/"]}},"created_at":"2020-04-03T19:03:50.000Z","updated_at":"2025-05-05T17:48:13.000Z","dependencies_parsed_at":"2023-12-12T23:30:53.775Z","dependency_job_id":"d3bc25c6-09d5-46dc-887b-93bcf8d77ade","html_url":"https://github.com/adamchainz/pytest-reverse","commit_stats":{"total_commits":301,"total_committers":3,"mean_commits":"100.33333333333333","dds":0.3322259136212624,"last_synced_commit":"6ca1cb7dba8b759111295a8a9a030049795545aa"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchainz%2Fpytest-reverse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchainz%2Fpytest-reverse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchainz%2Fpytest-reverse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamchainz%2Fpytest-reverse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamchainz","download_url":"https://codeload.github.com/adamchainz/pytest-reverse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518941,"owners_count":21921074,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pytest"],"created_at":"2024-08-03T17:00:59.852Z","updated_at":"2025-12-30T01:02:56.565Z","avatar_url":"https://github.com/adamchainz.png","language":"Python","readme":"==============\npytest-reverse\n==============\n\n.. image:: https://img.shields.io/github/actions/workflow/status/adamchainz/pytest-reverse/main.yml.svg?branch=main\u0026style=for-the-badge\n   :target: https://github.com/adamchainz/pytest-reverse/actions?workflow=CI\n\n.. image:: https://img.shields.io/pypi/v/pytest-reverse.svg?style=for-the-badge\n   :target: https://pypi.org/project/pytest-reverse/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge\n   :target: https://github.com/psf/black\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white\u0026style=for-the-badge\n   :target: https://github.com/pre-commit/pre-commit\n   :alt: pre-commit\n\nPytest plugin to reverse test order.\n\n----\n\n**Testing a Django project?**\nCheck out my book `Speed Up Your Django Tests \u003chttps://adamchainz.gumroad.com/l/suydt\u003e`__ which covers loads of recommendations to write faster, more accurate tests.\nI created pytest-reverse whilst working on the book!\n\n----\n\nInstallation\n============\n\nInstall with:\n\n.. code-block:: bash\n\n    python -m pip install pytest-reverse\n\nPython 3.10 to 3.14 supported.\n\nUsage\n=====\n\nPytest will automatically find the plugin and use it when you run ``pytest``.\nYou can reverse test order by passing the ``--reverse`` flag:\n\n.. code-block:: bash\n\n    pytest --reverse\n\nYou can make this always apply by adding it to the ``addopts`` setting in your\n``pytest.ini`` (or `other configuration\nfile \u003chttps://docs.pytest.org/en/latest/customize.html#adding-default-options\u003e`__):\n\n.. code-block:: ini\n\n    [pytest]\n    addopts = --reverse\n\nHistory\n=======\n\nI'm the creator and maintainer of\n`pytest-randomly \u003chttps://github.com/pytest-dev/pytest-randomly\u003e`__, a plugin\nfor randomly ordering tests. @thbde opened an issue there pointing to the paper\n`Empirically revisiting the test independence\nassumption \u003chttps://dl.acm.org/doi/10.1145/2610384.2610404\u003e`__, which covers\ntest reordering techniques. It turns out that reversal is nearly as effective\nas randomization.\n\nTest reversal is available `in Django's test\nrunner \u003chttps://docs.djangoproject.com/en/dev/ref/django-admin/#cmdoption-test-reverse\u003e`__.\nI figured such an option or plugin would exist for pytest already, but it\ndidn't, so I made it here.\n","funding_links":["https://adamj.eu/books/"],"categories":["Plugins"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamchainz%2Fpytest-reverse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamchainz%2Fpytest-reverse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamchainz%2Fpytest-reverse/lists"}