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.

Project Details

license

The MIT License Copyright (c) 2015 Eduardo Naufel Schettino

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for pytest-ignore-flaky-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78f8ddf9b405c09ce852a4ceac58258e4b8d98d2bc236a03d4a075cdc51c56c6
MD5 70ce56b2e17d07c909ed347a100cc8b2
BLAKE2b-256 92c49695430e7cdd842a1cc6ffbdf77724e5de0f801615e3abf8558a53dae9fb

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