pytest-ignore-flaky
ignore failures from flaky tests (pytest plugin)
A “flaky” test is a test that usually pass but sometimes it fails. You should always avoid flaky tests but not always possible.
This plugin can be used to optionally ignore failures from flaky tests.
First “mark” your tests with the flaky marker:
import random
import pytest
@pytest.mark.flaky
def test_mf():
assert 0 == random.randint(0, 1)
By default this mark is just ignored, unless the plugin is activated from the command line (or py.test config file):
py.test --ignore-flaky
If a flaky test pass it will be reported normally as test succeed. If the test fails, instead of being reported as failure it will be reported as a xfail.
pytest compatibility
Tested with pytest 6.2 (2021-04-23).
Project Details
Project code + issue track on github - https://github.com/coherent-oss/pytest-ignore-flaky
license
The MIT License Copyright (c) 2015-2019 Eduardo Naufel Schettino and Marcos Alfredo Camargo Leal Pinto
see LICENSE file
Metadata
Release files for pytest-ignore-flaky 2.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_ignore_flaky-2.2.1.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_ignore_flaky-2.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / pytest_ignore_flaky-2.2.1.tar.gz
| Download URL | pytest_ignore_flaky-2.2.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
04416f6b2177ef1f2adcb9308a887bf1cf77e7062d71778e404f358d4bbef0c9
|
|
BLAKE2b-256 checksum How to use checksums |
248dd3c8b28c46e11b7323424603f335d2e3e9cb3aed9eb6ca51c0227d1f8040
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / pytest_ignore_flaky-2.2.1-py3-none-any.whl
| Download URL | pytest_ignore_flaky-2.2.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6af6d4242080336ece1f0e67a0e2520625e37c492434b383ab5c841b385389a3
|
|
BLAKE2b-256 checksum How to use checksums |
6c546359cfacce98fdb501fb80a869fda084e1ab88de1b57c6def5f3a8990b1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|