[Pytest-commit] Issue #579: Request the feature to modify parametrized fixture with indirect modification (hpk42/pytest)

d3ph issues-reply at bitbucket.org
Wed Sep 3 10:26:39 CEST 2014


New issue 579: Request the feature to modify parametrized fixture with indirect modification
https://bitbucket.org/hpk42/pytest/issue/579/request-the-feature-to-modify-parametrized

d3ph:

It seems to me modifying already parametrized tests are reasonable:
```
#!python

import pytest

class SomeImpl:
    def __init__(self, name):
        self.name = name

    def get_name(self):
        return self.name

@pytest.fixture(params=['SomeOne', 'SomeTwo'])
def some(request):
    return SomeImpl(request.param)

def test_default(some):
    assert some.get_name()

@pytest.mark.parametrize('some', ['SomeOne'], indirect=True)
def test_only_one(some):
    assert some.get_name()

if __name__ == '__main__':
    pytest.main(args=[__file__])
```

Responsible: flub


More information about the pytest-commit mailing list