My test script is like below
@pytest.fixture(scope="Module", Autouse="True")
def setup_test():
....................
yield
............
def test_1()
...............
def test_2()
...............
def test_3()
...............
Sequential script execution is working fine. (First test setup -> Test1 -> Test2 ->Test3 -> Tear down) with pytest.
How to run script execution in parallel like :- First test setup -> All test cases in parallel -> Tear down?
If I use the -n option with pytest execution, it triggers all tests in parallel even before the setup section completes and executes the teardown section after all test cases.
I tried providing the --dist=load option, put setup & tear down in conftest file etc.
Nothing worked in my case.