[TIP] How to control combinations of parameterization in pytest?

arun kali raja arunsep886 at gmail.com
Fri May 19 07:04:18 PDT 2017

Hi all,

My test.py file looks something like this:


@pytest.fixture(scope='module')def moduleFixture(request):
   does something
@pytest.fixture(scope='function')def functionFixture(request):
   does something
def test_1(moduleFixture, functionFixture):
   does tests...

If i actually using pytest it generates 4 Testcases

test_1 [val1-val1]
test_1 [val1-val2]
test_1 [val2-val1]
test_1 [val2-val2]

But actually, val1-val2 and val2-val1 are invalid combinations for me!! :(

now how do control the permutation combinations and make sure that my
testcase skips for these wrong combinations?
Have posted the same in stackOverflow too..


B.Arun Kaliraja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20170519/99c22bc3/attachment-0001.htm>

More information about the testing-in-python mailing list