{"id":13772072,"url":"https://github.com/pytest-dev/pytest-repeat","last_synced_at":"2025-05-11T04:31:07.387Z","repository":{"id":45765579,"uuid":"44554687","full_name":"pytest-dev/pytest-repeat","owner":"pytest-dev","description":"pytest plugin for repeating test execution","archived":false,"fork":false,"pushed_at":"2025-04-07T15:00:40.000Z","size":72,"stargazers_count":177,"open_issues_count":17,"forks_count":28,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-10T00:03:15.218Z","etag":null,"topics":["plugin","pytest","repeat"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/pytest-repeat/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pytest-dev.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-19T18:22:55.000Z","updated_at":"2025-04-16T23:09:10.000Z","dependencies_parsed_at":"2024-06-18T13:54:13.138Z","dependency_job_id":"7131e72c-0b7c-41be-be1b-bdab4eef0b9d","html_url":"https://github.com/pytest-dev/pytest-repeat","commit_stats":{"total_commits":71,"total_committers":16,"mean_commits":4.4375,"dds":0.647887323943662,"last_synced_commit":"f6da17158bc0dc6c2c022a26dcc79f39ba3415cf"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-repeat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-repeat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-repeat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pytest-dev%2Fpytest-repeat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pytest-dev","download_url":"https://codeload.github.com/pytest-dev/pytest-repeat/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":["plugin","pytest","repeat"],"created_at":"2024-08-03T17:00:59.592Z","updated_at":"2025-05-11T04:31:07.375Z","avatar_url":"https://github.com/pytest-dev.png","language":"Python","readme":"pytest-repeat\n===================\n\npytest-repeat is a plugin for `pytest \u003chttps://docs.pytest.org\u003e`_ that makes it\neasy to repeat a single test, or multiple tests, a specific number of times.\n\n|license| |python| |version| |anaconda| |ci| |issues|\n\n.. |license| image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg\n   :target: https://github.com/pytest-dev/pytest-repeat/blob/master/LICENSE\n\n.. |version| image:: http://img.shields.io/pypi/v/pytest-repeat.svg\n  :target: https://pypi.python.org/pypi/pytest-repeat\n\n.. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-repeat.svg\n    :target: https://anaconda.org/conda-forge/pytest-repeat\n\n.. |ci| image:: https://github.com/pytest-dev/pytest-repeat/workflows/test/badge.svg\n  :target: https://github.com/pytest-dev/pytest-repeat/actions\n\n.. |python| image:: https://img.shields.io/pypi/pyversions/pytest-repeat.svg\n  :target: https://pypi.python.org/pypi/pytest-repeat/\n\n.. |issues| image:: https://img.shields.io/github/issues-raw/pytest-dev/pytest-repeat.svg\n   :target: https://github.com/pytest-dev/pytest-repeat/issues\n\n\nRequirements\n------------\n\nYou will need the following prerequisites in order to use pytest-repeat:\n\n- Python 3.9+ or PyPy3\n- pytest 5 or newer\n\nInstallation\n------------\nTo install pytest-repeat:\n\n.. code-block:: bash\n\n  $ pip install pytest-repeat\n\nRepeating a test\n----------------\n\nUse the :code:`--count` command line option to specify how many times you want\nyour test, or tests, to be run:\n\n.. code-block:: bash\n\n  $ pytest --count=10 test_file.py\n\nEach test collected by pytest will be run :code:`count` times.\n\nIf you want to mark a test in your code to be repeated a number of times, you\ncan use the :code:`@pytest.mark.repeat(count)` decorator:\n\n.. code-block:: python\n\n   import pytest\n\n\n   @pytest.mark.repeat(3)\n   def test_repeat_decorator():\n       pass\n\nIf you want to override default tests executions order, you can use :code:`--repeat-scope`\ncommand line option with one of the next values: :code:`session`,  :code:`module`, :code:`class` or :code:`function` (default).\nIt behaves like a scope of the pytest fixture.\n\n:code:`function` (default) scope repeats each test :code:`count` or :code:`repeat` times before executing next test.\n:code:`session` scope repeats whole tests session, i.e. all collected tests executed once, then all such tests executed again and etc.\n:code:`class` and :code:`module` behaves similar :code:`session` , but repeating set of tests is a tests from class or module, not all collected tests.\n\nRepeating a test until failure\n------------------------------\n\nIf you are trying to diagnose an intermittent failure, it can be useful to run the same\ntest over and over again until it fails. You can use pytest's :code:`-x` option in\nconjunction with pytest-repeat to force the test runner to stop at the first failure.\nFor example:\n\n.. code-block:: bash\n\n  $ pytest --count=1000 -x test_file.py\n\nThis will attempt to run test_file.py 1000 times, but will stop as soon as a failure\noccurs.\n\nUnitTest Style Tests\n--------------------\n\nUnfortunately pytest-repeat is not able to work with unittest.TestCase test classes.\nThese tests will simply always run once, regardless of :code:`--count`, and show a warning.\n\nResources\n---------\n\n- `Release Notes \u003chttps://github.com/pytest-dev/pytest-repeat/blob/master/CHANGES.rst\u003e`_\n- `Issue Tracker \u003chttps://github.com/pytest-dev/pytest-repeat/issues\u003e`_\n- `Code \u003chttps://github.com/pytest-dev/pytest-repeat/\u003e`_\n","funding_links":[],"categories":["Plugins"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-repeat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpytest-dev%2Fpytest-repeat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpytest-dev%2Fpytest-repeat/lists"}