I have a dictionary:
methodCategory = methodCategory2 (it is dynamic variable, so don't mind it)
methods = {'methodCategory': ['methodname1', 'methodname2'],
'methodCategory2': ['methodname1', 'methodname2''],
...
}
And I also have a pytest Class:
@pytest.mark.parameterized('methodname', methods[methodCategory])
class TestName:
def test_1(methodname):
def test_2(methodname):
def test_3(methodname):
def test_4(methodname):
I want to do all tests for each methodname first, then do all test for the second methodname:
test_1[methodname1]
test_2[methodname1]
test_3[methodname1]
test_4[methodname1]
test_1[methodname2]
but it goes like:
test_1[methodname1]
test_1[methodname2]
test_2[methodname1]
test_2[methodname2]
How can I loop one methodname through all tests, then loop the 2nd methodname?