Description
Originally reported by: Alex Stapleton (BitBucket: private, GitHub: private)
If you call parametrize on a test more than once for different arguments of the test it doesn't seem to combine the parameters correctly if some of them are empty. This results in tests that would normally get skipped because their parametisation is missing values receiving the internal _notset
sentinel object for that fixture.
Examples here https://gist.github.com/public/e671a53b70fbb6fb6129
The last example is the simplest reproduction of the problem.
This does not get skipped and fixP
is _notset
.
@pytest.mark.parametrize(["fixP"], [(1,)])
@pytest.mark.parametrize(["fixQ"], [])
def test_fixA_fixB_bad2(fixP, fixQ):
print fixP, fixQ
but if you swap the order of the calls to parametrize...
@pytest.mark.parametrize(["fixQ"], [])
@pytest.mark.parametrize(["fixP"], [(1,)])
def test_fixA_fixB_bad2(fixP, fixQ):
print fixP, fixQ
it skips as you would expect from reading the documentation.
I've reproduced this on 2.5.2 and on the current master 2.6 branch.