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/schettino72/pytest-ignore-flaky/workflows/test/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.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

pytest_ignore_flaky-2.1.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytest-ignore-flaky-2.1.0.tar.gz
Algorithm Hash digest
SHA256 bbdb2615df1a4854661ec52fff102b9ea47dcc08df6e46da521e0468d36467e1
MD5 60cab8e35ac5f031768de2176811ab71
BLAKE2b-256 5e1dec566a60a02fad11b5a5a73be05e6bfae0b776d006be758e70d1cc5011a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_ignore_flaky-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72c9567f57d941e67385443030a0ff12d4efc28a4e405c0292111c9c900e6c00
MD5 90ae2df882cea8e309e0b213ff794aa8
BLAKE2b-256 0469c369fe61b15e775f950638fe1a23b7175f3f07383ff40800cc46188fe2da

See more details on using hashes here.

Supported by

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