Skip to main content
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

pip install pytest-flakefinder

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

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.

Release files for pytest-flakefinder 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-flakefinder 1.1.0
File Size Uploaded
pytest-flakefinder-1.1.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-flakefinder 1.1.0
File Interpreter ABI Platform
pytest_flakefinder-1.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 11.4 kB

Release files / pytest-flakefinder-1.1.0.tar.gz

Download URL pytest-flakefinder-1.1.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2412a1920bdb8e7908783b20b3d57e9dad590cc39a93e8596ffdd493b403e0e
BLAKE2b-256 checksum
How to use checksums
ec5369c56a93ea057895b5761c5318455804873a6cd9d796d7c55d41c2358125
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Release files / pytest_flakefinder-1.1.0-py2.py3-none-any.whl

Download URL pytest_flakefinder-1.1.0-py2.py3-none-any.whl
Size 4.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
741e0e8eea427052f5b8c89c2b3c3019a50c39a59ce4df6a305a2c2d9ba2bd13
BLAKE2b-256 checksum
How to use checksums
338b06787150d0fd0cbd3a8054262b56f91631c7778c1bc91bf4637e47f909ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page