[pytest-dev] [ANN] pytest-ignore-flaky plugin 0.1.0
Eduardo Schettino
schettino72 at gmail.com
Tue Aug 11 06:48:13 CEST 2015
Hi,
I just published a new plugin to hadle flaky tests:
https://pypi.python.org/pypi/pytest-ignore-flaky
https://github.com/schettino72/pytest-ignore-flaky
feedback welcome
cheers,
Eduardo
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`.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20150811/07a96f8f/attachment.html>
More information about the pytest-dev
mailing list