skip to navigation
skip to content

pytest-flakefinder 0.1.0

Runs tests multiple times to expose flakiness.

Runs tests multiple times to expose flakiness.

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


  • 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.


Install with

python install

For best flake-finding combine with pytest-xdist:

pip install pytest-xdist


Flake Finding

Enable plugin for tests:

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

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

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

py.test --flake-finder --flake-max-minutes=minutes

Tests started after the timeout will be skipped.


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.


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

File Type Py Version Uploaded on Size
pytest-flakefinder-0.1.0.tar.gz (md5) Source 2016-03-21 5KB
pytest_flakefinder-0.1.0-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2016-03-21 5KB