-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed
Description
In the docs, you provide a signature of the xfail marker:
def xfail(condition=None, *, reason=None, raises=None, run=True, strict=False):
However, trying to use the xfail marker with a condition keyword argument will cause it to always xfail the test, no matter the evaluation of the argument.
Quick example:
import pytest
@pytest.mark.xfail(condition=False, reason="this test should pass")
def test_xfail1():
assert True
@pytest.mark.xfail(False, reason="this test actually passes")
def test_xfail2():
assert True
Metadata
Metadata
Assignees
Labels
type: bugproblem that needs to be addressedproblem that needs to be addressed