Skip to content

Unable to combine xfail and parametrize #9695

Answered by nicoddemus
pablojadz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @pablojadz,

is there a way I could do this?

You can call pytest.xfail explicitly inside the test:

@pytest.mark.parametrize('param1', [0, 1])
@pytest.mark.parametrize('param2', [0, 1])
def test(param1, param2):
    if param1 and param2:
        pytest.xfail(reason="param1 and param2 are 1")

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pablojadz
Comment options

Answer selected by pablojadz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants