Skip to main content

ignore failures from flaky tests (pytest plugin)

Project description

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

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_ignore_flaky-2.2.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

pytest_ignore_flaky-2.2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest_ignore_flaky-2.2.1.tar.gz.

File metadata

  • Download URL: pytest_ignore_flaky-2.2.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pytest_ignore_flaky-2.2.1.tar.gz
Algorithm Hash digest
SHA256 04416f6b2177ef1f2adcb9308a887bf1cf77e7062d71778e404f358d4bbef0c9
MD5 a4f9c7816b0afae1703a311cbc731ed7
BLAKE2b-256 248dd3c8b28c46e11b7323424603f335d2e3e9cb3aed9eb6ca51c0227d1f8040

See more details on using hashes here.

File details

Details for the file pytest_ignore_flaky-2.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_ignore_flaky-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6af6d4242080336ece1f0e67a0e2520625e37c492434b383ab5c841b385389a3
MD5 332d656a076706266899f7b299d8a0b8
BLAKE2b-256 6c546359cfacce98fdb501fb80a869fda084e1ab88de1b57c6def5f3a8990b1f

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