New issue 510: Multiple calls to parametrize result in empty value lists not 
skipping the test
https://bitbucket.org/hpk42/pytest/issue/510/multiple-calls-to-parametrize-result-in

Alex Stapleton:



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.


_______________________________________________
pytest-commit mailing list
pytest-commit@python.org
https://mail.python.org/mailman/listinfo/pytest-commit

Reply via email to