<div dir="ltr"><div dir="ltr">Fabian,<div><br></div><div>`setup_module(module)` is a supported nose function.</div><div><br></div><div>I know that I'm not giving you the answer that you want, which is essentially to be able to grab config from your `setup_module(module)` as is.</div><div><br></div><div>However, you are already using pytest. Why are you holding onto `setup_module(module)`?</div><div><br></div><div>If you change the signature of that function to be a proper pytest fixture, it will then be easy.</div><div><br></div><div>``</div><div>@pytest.fixture(scope='module', autouse=True)</div><div>def setup_module(name):</div><div> print(f"\nsetup_module() name: {name}")`</div><div>```</div><div><br></div><div>Regards,</div><div>Brian</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2019 at 7:13 AM Fabian Cenedese <<a href="mailto:Cenedese@indel.ch">Cenedese@indel.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">At 14:54 22.03.2019, you wrote:<br>
<br>
>Fabian,<br>
>Use the new `pytestconfig` fixture.<br>
><br>
># --------- conftest.py<br>
><br>
>def pytest_addoption(parser):<br>
> parser.addoption("--name", action="store", default="default name")<br>
><br>
># ------- test_param.py <br>
>import pytest<br>
><br>
>@pytest.fixture()<br>
>def name(pytestconfig):<br>
> return pytestconfig.getoption("name")<br>
><br>
>def test_print_name(name):<br>
> print(f"\ncommand line param (name): {name}")<br>
<br>
I have already seen the example with normal test functions. But I want<br>
to use the value in the setup function which is defined as<br>
<br>
def setup_module(module):<br>
<br>
so I can't add the fixture there. How I can use the value in the setup?<br>
<br>
Thanks<br>
<br>
bye Fabi<br>
<br>
</blockquote></div>