jeudi 23 août 2018

Pytest - How to override fixture parameter list from command line?

Consider the following fixture

@pytest.fixture(params=['current', 'legacy'])
def baseline(request):
    return request.param

I wonder if there is a way to launch pytest so it overrides the fixture parameter list with the value(s) given on the command line, i.e.:

pytest --baseline legacy tests/

The above should effectively result in params=['legacy'].

Aucun commentaire:

Enregistrer un commentaire