[Pytest-commit] Issue #621: Random "object" shows up with multiple parametrization (hpk42/pytest)

Alex Gaynor issues-reply at bitbucket.org
Fri Oct 24 19:31:34 CEST 2014


New issue 621: Random "object" shows up with multiple parametrization
https://bitbucket.org/hpk42/pytest/issue/621/random-object-shows-up-with-multiple

Alex Gaynor:

If you parametrize a test twice, with one of them being an empty list, you end up with a random instance of `object` being passed to that fixture. Here is an example:

```
import pytest


@pytest.mark.parametrize("b", [1])
@pytest.mark.parametrize("a", [])
def test_foo(a, b):
    raise ZeroDivisionError(a)
```

(this also shows up with `metafunc.parametrize()`, which is how I originally discovered it)

If you don't have teh `parametrize("b", [1])`, it correctly skips the test.




More information about the pytest-commit mailing list