I'm quite new to pytest and I would like to know how to mark a test as "expected to fail" when called with certain parameters. I parametrize test like this:
@pytest.mark.parametrize("param1", [False, True])
@pytest.mark.parametrize("param2", [1, 2, 3])
def test_foo(self, param1, param2):
...
What I'm trying to achieve is that when the test is called with (param1 == True and param2 == 2)
, the test should fail; whilst any other parameter combinations should pass.
But I haven't found any way to do this. Do you have any ideas?