<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/13 holger krekel <span dir="ltr"><<a href="mailto:holger@merlinux.eu" target="_blank">holger@merlinux.eu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, Dec 13, 2013 at 15:06 +0100, Wouter Overmeire wrote:<br>
> Somehow i missed the point that it is possible to access the config object<br>
> trough the metafunc argument of pytest_generate_tests when i first looked<br>
> at the docs. Based on your recommendations i gave it another go, problem<br>
> solved. Thanks for your feedback!<br>
><br>
> There is however another problem now. There is a big difference in the<br>
> order of configuration / test execution when deferring the setup of<br>
> parametrized resources.<br>
> When using the params argument of the pytest.fixture decorator the tests<br>
> are run such that for a given config of the platform, all tests run after<br>
> each other. This is what i want, since the config is time-consuming<br>
> compared to running the tests. When using the pytest_generate_tests<br>
> function to parameterize the platform fixture, the tests are run, such that<br>
> one give tests is executed for all configs, than the next test for all<br>
> selcted configs, and so on. Is there an easy way to change the ordering? Or<br>
> should i implement my own ordering, maybe using<br>
> pytest_collection_modifyitems?<br>
<br>
</div>If configs are a per-session thing (it sounds so), you should additionally<br>
pass "scope='session'" to metafunc.parametrize(), which should effect<br>
the ordering you ask for. Other caching scope values are 'module' or 'class'<br>
but most often people use 'session' and 'function' (the default).<br>
<br>
Does that solve it?<br></blockquote><div><br></div><div>Yes it does.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
cheers,<br>
holger<br>
</blockquote></div><br></div></div>