All Projects → pytest-dev → Pytest Repeat

pytest-dev / Pytest Repeat

Licence: other
pytest plugin for repeating test execution

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytest Repeat

Pytest Html
Plugin for generating HTML reports for pytest results
Stars: ✭ 404 (+308.08%)
Mutual labels:  plugin, pytest
Pytest Selenium
Plugin for running Selenium with pytest
Stars: ✭ 246 (+148.48%)
Mutual labels:  plugin, pytest
Pytest Datadir
pytest plugin for manipulating test data directories and files
Stars: ✭ 135 (+36.36%)
Mutual labels:  plugin, pytest
Pytest Mimesis
Mimesis integration with the pytest test runner. This plugin provider useful fixtures based on providers from Mimesis.
Stars: ✭ 46 (-53.54%)
Mutual labels:  plugin, pytest
Hxd Plugin Framework
Plugin framework for HxD's data inspector
Stars: ✭ 98 (-1.01%)
Mutual labels:  plugin
Unityionicintegration
A guide to integrating Unity 3D content into an Ionic app and sending messages between them (for Android & iOS)(tested with Vuforia plugin)
Stars: ✭ 94 (-5.05%)
Mutual labels:  plugin
Matter Attractors
an attractors plugin for matter.js
Stars: ✭ 93 (-6.06%)
Mutual labels:  plugin
Sniprun
A neovim plugin to run lines/blocs of code (independently of the rest of the file), supporting multiples languages
Stars: ✭ 93 (-6.06%)
Mutual labels:  plugin
Close Buffers.vim
📖 Quickly close (bdelete) several buffers at once 📕
Stars: ✭ 99 (+0%)
Mutual labels:  plugin
Latestversionplugin
LatestVersion Plugin for Xamarin and Windows apps
Stars: ✭ 99 (+0%)
Mutual labels:  plugin
Ion Digit Keyboard V2
A digital keyboard plugin to use in Ionic 2 applications.
Stars: ✭ 97 (-2.02%)
Mutual labels:  plugin
Colorfulsidebar
📂 MacForge plugin to add color back to the sidebar icons in Finder on macOS
Stars: ✭ 95 (-4.04%)
Mutual labels:  plugin
Dark Mode
Dark Mode for the WordPress dashboard.
Stars: ✭ 98 (-1.01%)
Mutual labels:  plugin
Mongoose Fuzzy Searching
Mongoose Fuzzy Searching Plugin
Stars: ✭ 94 (-5.05%)
Mutual labels:  plugin
Typescript Eslint
✨ Monorepo for all the tooling which enables ESLint to support TypeScript
Stars: ✭ 10,831 (+10840.4%)
Mutual labels:  plugin
Cypress Webpack Preprocessor
Cypress preprocessor for bundling JavaScript via webpack
Stars: ✭ 93 (-6.06%)
Mutual labels:  plugin
Fork Ts Checker Webpack Plugin
Webpack plugin that runs typescript type checker on a separate process.
Stars: ✭ 1,343 (+1256.57%)
Mutual labels:  plugin
Parrot
A package to rotate text and party with parrots at the same time
Stars: ✭ 99 (+0%)
Mutual labels:  plugin
Nuxt Netlify
Dynamically generate `_headers` and `_redirects` files for Netlify in your Nuxt.js projects
Stars: ✭ 97 (-2.02%)
Mutual labels:  plugin
Pytest Cookies
The pytest plugin for your Cookiecutter templates. 🍪
Stars: ✭ 96 (-3.03%)
Mutual labels:  pytest

pytest-repeat

pytest-repeat is a plugin for pytest <https://docs.pytest.org>_ that makes it easy to repeat a single test, or multiple tests, a specific number of times.

.. image:: https://img.shields.io/badge/license-MPL%202.0-blue.svg :target: https://github.com/pytest-dev/pytest-repeat/blob/master/LICENSE :alt: License .. image:: https://img.shields.io/pypi/v/pytest-repeat.svg :target: https://pypi.python.org/pypi/pytest-repeat/ :alt: PyPI .. image:: https://img.shields.io/pypi/pyversions/pytest-repeat.svg :target: https://pypi.org/project/pytest-repeat/ :alt: Python versions .. image:: https://img.shields.io/travis/pytest-dev/pytest-repeat.svg :target: https://travis-ci.org/pytest-dev/pytest-repeat/ :alt: Travis .. image:: https://img.shields.io/github/issues-raw/pytest-dev/pytest-repeat.svg :target: https://github.com/pytest-dev/pytest-repeat/issues :alt: Issues .. image:: https://img.shields.io/requires/github/pytest-dev/pytest-repeat.svg :target: https://requires.io/github/pytest-dev/pytest-repeat/requirements/?branch=master :alt: Requirements

Requirements

You will need the following prerequisites in order to use pytest-repeat:

  • Python 2.7, 3.5+ or PyPy
  • pytest 3.6 or newer

Installation

To install pytest-repeat:

.. code-block:: bash

$ pip install pytest-repeat

Repeating a test

Use the :code:--count command line option to specify how many times you want your test, or tests, to be run:

.. code-block:: bash

$ pytest --count=10 test_file.py

Each test collected by pytest will be run :code:count times.

If you want to mark a test in your code to be repeated a number of times, you can use the :code:@pytest.mark.repeat(count) decorator:

.. code-block:: python

import pytest

@pytest.mark.repeat(3) def test_repeat_decorator(): pass

If you want to override default tests executions order, you can use :code:--repeat-scope command line option with one of the next values: :code:session, :code:module, :code:class or :code:function (default). It behaves like a scope of the pytest fixture.

:code:function (default) scope repeats each test :code:count or :code:repeat times before executing next test. :code:session scope repeats whole tests session, i.e. all collected tests executed once, then all such tests executed again and etc. :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.

Repeating a test until failure

If you are trying to diagnose an intermittent failure, it can be useful to run the same test over and over again until it fails. You can use pytest's :code:-x option in conjunction with pytest-repeat to force the test runner to stop at the first failure. For example:

.. code-block:: bash

$ pytest --count=1000 -x test_file.py

This will attempt to run test_file.py 1000 times, but will stop as soon as a failure occurs.

UnitTest Style Tests

Unfortunately pytest-repeat is not able to work with unittest.TestCase test classes. These tests will simply always run once, regardless of :code:--count, and show a warning.

Resources

  • Release Notes <https://github.com/pytest-dev/pytest-repeat/blob/master/CHANGES.rst>_
  • Issue Tracker <https://github.com/pytest-dev/pytest-repeat/issues>_
  • Code <https://github.com/pytest-dev/pytest-repeat/>_
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].