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 https://github.com/coherent-oss/pytest-ignore-flaky/actions/workflows/main.yml/badge.svg

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.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

pytest_ignore_flaky-2.2.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file pytest-ignore-flaky-2.2.0.tar.gz.

File metadata

  • Download URL: pytest-ignore-flaky-2.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pytest-ignore-flaky-2.2.0.tar.gz
Algorithm Hash digest
SHA256 e3fb91f3513babf8ad1a4175592be81da208ebd99b2f772cf6ce5cbfb94c7e64
MD5 e3db9c71c59c41a562acdcf54a101807
BLAKE2b-256 26fb4c2cf03b436ab8a1415bd04ad24affbf2bac430343cf4f3119015b98b33b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_ignore_flaky-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60e9272541875e74a2e1ba197c46468150fb0217fe714b51fd45bb4d9dfac20a
MD5 3e5edd2677ad28121be145275e805d0a
BLAKE2b-256 d8fcb353e4952311069863f7968f78f81d5172882ce0d90506eec9e68ae3591a

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