[TIP] Modifying fixture parametrization from the command line
lpbrac at dolby.com
Wed Oct 29 09:22:34 PDT 2014
I have been struggling with this issue and couldn't find a way to make
For sake of simplicity, say I take in the example from the documentation
but want to give the user the ability, to change the list of mail
servers from the command line (say smtp.gmail.com).
smtp = smtplib.SMTP(request.param)
The problem I had is that list given in "params" is created when
conftest is loaded which is before the pytest_addoption and
pytest_configure are invoked.
I tried to use a global variable (yuk) and modify the list content in
the hook hoping that the fixture keeps the same reference but this
Is there anyway I can do this?
Thanks in advance.
More information about the testing-in-python