New issue 736: Parametrized argument named similarly to fixture (contains it)
breaks that fixture's parametrization
https://bitbucket.org/pytest-dev/pytest/issue/736/parametrized-argument-named-similarly-to
Jacobo Giralt:
```
#!python
import pytest
@pytest.fixture(params=[1,2,3])
def foo(request):
return request.param
@pytest.mark.parametrize('foobar', [4,5,6])
def test_issue(foo, foobar):
assert True
```
```
#!python
request = <SubRequest 'foo' for <Function 'test_issue[4]'>>
@pytest.fixture(params=[1,2,3])
def foo(request):
> return request.param
AttributeError: SubRequest instance has no attribute 'param'
```
The issue seems reproducible as long as the parametrized test argument contains
the fixture name as a substring, e.g. foobar, barfoo, foox, xfoo, disappears as
soon as I modify the fixture name to anything else.
This same code works in pytest-2.6.4 and fails for 2.7.
_______________________________________________
pytest-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pytest-commit