pytest-ignore-flaky 2.2.1


pip install pytest-ignore-flaky

  Latest version

Released: Apr 20, 2024

Project Links

Meta
Author: Eduardo Naufel Schettino, Marcos Alfredo Camargo Leal Pinto
Maintainer: Jason R. Coombs
Requires Python: >=3.8

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Natural Language
  • English

Operating System
  • OS Independent
  • POSIX

Programming Language
  • Python :: 3
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12

Topic
  • Software Development :: Testing
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

Extras:
Dependencies:
pytest (>=6.0)