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:

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

pytest-flakefinder-0.1.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

pytest_flakefinder-0.1.2-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: pytest-flakefinder-0.1.2.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

Hashes for pytest-flakefinder-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c9d8400897a542140c7b70c3b62e4f2b45c2e327dde6aa7cca3478e5d3aa723e
MD5 4ff68bf7f8c47110711f83b85595de1a
BLAKE2b-256 bb969d269f35cc307cc8c09542f5961afb0d6b67bf6058bc8678f54bf724b816

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_flakefinder-0.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.5 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

Hashes for pytest_flakefinder-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a76f2b1bd219e27e638505af41b33553f7ab7637ba9ef63cff2f8e20b5829a28
MD5 0cf8f1c345036a0f32e156450b059edb
BLAKE2b-256 04dde0071e74b4dbc2481acffa3897823e7c86f7d44fa5b4842099763ecdd3f1

See more details on using hashes here.

Supported by

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