Skip to main content

Runs tests multiple times to expose flakiness.

Project description

Build Status

Runs tests multiple times to expose flakiness.


This Pytest plugin was generated with Cookiecutter along with @hackebrot’s Cookiecutter-pytest-plugin template.

Features

  • When enabled it will ‘multiply’ your tests so that they get run multiple times without having to restart pytest. This helps you find flakiness in your tests.

  • You can limit your flake runs to a particular timeout value.

Installation

Install with setup.py:

python setup.py install

For best flake-finding combine with pytest-xdist:

pip install pytest-xdist

Usage

Flake Finding

Enable plugin for tests:

pytest --flake-finder

This will run every test the default, 50, times. Every test is run independently and you can even use xdist to send tests to multiple processes.

To configure the number of runs:

pytest --flake-finder --flake-runs=runs

To find flakes in one test or a couple of tests you can use pytest’s built in test selectiong.

Finding flakes in one test:

pytest -k test_maybe_flaky --flake-finder

When used with xdist the flake finder can expose many timing related flakes.

Timing Out

When using flake-finder as part of a CI run it might be useful to limit the amount of time it will run.

Running with timeout:

pytest --flake-finder --flake-max-minutes=minutes

Tests started after the timeout will be skipped.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

Contributors

Issues

If you encounter any problems, please file an issue along with a detailed description.

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-flakefinder-1.0.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_flakefinder-1.0.0-py2.py3-none-any.whl (4.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-flakefinder-1.0.0.tar.gz.

File metadata

  • Download URL: pytest-flakefinder-1.0.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.17

File hashes

Hashes for pytest-flakefinder-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1bdfaeaad4699cfb3b295e24c359e403e6261eabca9ba9bdffbaba8cabe87d63
MD5 23c6d42b7464e9f0131a41ebce9c8d2a
BLAKE2b-256 f734625358ef6b05623a7e503d9f304ee9a9df711503a75e374864bbfd878906

See more details on using hashes here.

File details

Details for the file pytest_flakefinder-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_flakefinder-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.17

File hashes

Hashes for pytest_flakefinder-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1d7761402e6e90d8c0a34b33b19799f8ce1c396623025528dccc1329a53d4e66
MD5 2ebb660c4b8072c904b76a30d515c908
BLAKE2b-256 9bf66df7e1eec06522eb67d3eae9b88e1204c95d2ae79750f72ab39c8af8b693

See more details on using hashes here.

Supported by

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