Runs tests multiple times to expose flakiness.
Project description
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:
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.
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
Built Distribution
File details
Details for the file pytest-flakefinder-0.1.3.tar.gz
.
File metadata
- Download URL: pytest-flakefinder-0.1.3.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d41b90249778469bf3ab6c205ff6fa40acde478280fcdc7f981ecfb3d281eb8 |
|
MD5 | b83eca8d433c9d84c83c11d30192dcd6 |
|
BLAKE2b-256 | d82b31e3c11f1288e04d71e4c6edac3975a2b215851708468e9f2bf95eacc272 |
File details
Details for the file pytest_flakefinder-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: pytest_flakefinder-0.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 022e6bb03236171fb253639dadbf1d690d384a4bdd230281407e4d7b0c0385b3 |
|
MD5 | 74d486ce8614d5c3c827c095fbcbb39a |
|
BLAKE2b-256 | 03e17abdc6e3913f22b4853f10e28463887677d48c27f8e8107d96a5bee7dddb |