I have a test class that has one parametrized class and some tests inside of it, that each have their own parametrize method. I want the class to run all tests inside of it with one class parameter and only after all tests have finished, run the tests again with the second parameter. For e.g.: The code is like this:
@pytest.mark.parametrize("param_a",[1,2])
class TestTest():
@pytest.mark.parametrize("param_b",[3,4])
def test_1(self, param):
pass
@pytest.mark.parametrize("param_b",[3,4])
def test_2(self,param):
pass
Now it uses parameters like this:
test_tmp.py::TestTest::test_1[1][3]
test_tmp.py::TestTest::test_1[1][4]
test_tmp.py::TestTest::test_1[2][3]
test_tmp.py::TestTest::test_1[2][4]
test_tmp.py::TestTest::test_2[1][3]
test_tmp.py::TestTest::test_2[1][4]
test_tmp.py::TestTest::test_2[2][3]
test_tmp.py::TestTest::test_2[2][4]
And I would like it to use the parameters like this:
test_tmp.py::TestTest::test_1[1][3]
test_tmp.py::TestTest::test_1[1][4]
test_tmp.py::TestTest::test_2[1][3]
test_tmp.py::TestTest::test_2[1][4]
test_tmp.py::TestTest::test_1[2][3]
test_tmp.py::TestTest::test_1[2][4]
test_tmp.py::TestTest::test_2[2][3]
test_tmp.py::TestTest::test_2[2][4]
Is there any way to achieve this?