Skip to main content

pytest plugin for repeating tests

Project description

pytest-repeat is a plugin for py.test that makes it easy to repeat a single test, or multiple tests, a specific number of times.

License PyPI Travis Issues Requirements

Requirements

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

  • Python 2.6, 2.7, 3.2, 3.3, 3.4 or PyPy

  • py.test 2.4 or newer

Installation

To install pytest-repeat:

pip install pytest-repeat

Repeating a test

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

py.test --count=10 test_file.py

Each test collected by py.test will be run count times.

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 py.test’s -x option in conjunction with pytest-repeat to force the test runner to stop at the first failure. For example:

py.test --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.

Resources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-repeat-0.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

pytest_repeat-0.2-py2.py3-none-any.whl (4.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-repeat-0.2.tar.gz.

File metadata

  • Download URL: pytest-repeat-0.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pytest-repeat-0.2.tar.gz
Algorithm Hash digest
SHA256 2cbbe5856dbf43fb56ffa045ffd0e5ae46f01904ec01cc1736310b755aa80f51
MD5 ad465d411c37cadcf7ce2d112a421191
BLAKE2b-256 e01ed14a0e8d665600d860e0614f1af95398cdc6772bd9af79ed0c18e117ba5f

See more details on using hashes here.

File details

Details for the file pytest_repeat-0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_repeat-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d19c87f951456bec978e1a16bcad78dd0874fa3bc2a1762e2a218796fbd6db0a
MD5 b53407da4cfd01e50c2b30e4eb79eae5
BLAKE2b-256 48ef56564d5a6a663163b8ce8296ad99863795c007d16a6ef0218856521d18ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page