Skip to content

Flaky decorators on individual tests have no effect if --force-flaky argument is passed #209

@tdluk

Description

@tdluk

From README.rst:

Pass --max-runs=MAX_RUNS and/or --min-passes=MIN_PASSES to control the behavior of flaky if --force-flaky is specified. Flaky decorators on individual tests will override these defaults.

However, flaky decorators on individual tests do not override these defaults.

To repro the issue, consider the following test file test.py:

import pytest

@pytest.mark.flaky(max_runs=10)
def test_foo():
    assert False

Then run pytest test.py --force-flaky and observe the test was run the default 2 times instead of the 10 specified by the decorator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions