I wanted to run parameterized test functions in parallel. This is for a concurrency testing scenario. Same testcase runs in parallel with different parameters in a device. After completing all the parameterized variant of one test function, I want to proceed with the next one.
If we take this simple example, I want to run all 4 instances of test_even parallely and then move to test_odd.
@pytest.mark.parametrize("x", range(4))
def test_even(x):
assert x % 2 == 0
@pytest.mark.parametrize("x", range(4))
def test_odd(x):
assert x % 2 != 0
Is it possible to do in pytest? I checked xdist, but could not find this type of support. Could anybody please give some pointers on how to implement this in pytest?