Skip to main content
https://img.shields.io/pypi/v/pytest-ignore-flaky.svg https://img.shields.io/pypi/pyversions/pytest-ignore-flaky.svg tests Ruff https://readthedocs.org/projects/pytest-ignore-flaky/badge/?version=latest https://img.shields.io/badge/skeleton-2024-informational

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

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)

Source distribution for pytest-ignore-flaky 2.2.1
File Size Uploaded
pytest_ignore_flaky-2.2.1.tar.gz 9.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-ignore-flaky 2.2.1
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

2.2.1 This release

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.1.1

1 release file

0.1.0

1 release file

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