Skip to main content

ignore failures from flaky tests (pytest plugin)

Project description

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-ignore-flaky-2.0.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for pytest-ignore-flaky-2.0.0.tar.gz
Algorithm Hash digest
SHA256 9de6cc7648db067723b9a85c63aceace61d639ab41db389f22644d660e379d50
MD5 0d631bd656f13c285357ee3d09d0926e
BLAKE2b-256 5c88fde229187293f0bc5830a5e34d761a31aeb32b4cd161fbfc58d947cf8386

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_ignore_flaky-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for pytest_ignore_flaky-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43ab9a8bfcc81b56bb9a4461d7f6e9e07f75e1aa3f41d3a6527998089910aa43
MD5 c97ab4f300ed70084411e1c73a7b7c63
BLAKE2b-256 22bf4a670d28c8c37569e26536c068d83b37a01aea9fff9a45a03ae3be5344b9

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