Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Xfail does not work with condition keyword argument. #1496
In the docs, you provide a signature of the xfail marker:
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.
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