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.


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

Reply via email to