<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/13 holger krekel <span dir="ltr">&lt;<a href="mailto:holger@merlinux.eu" target="_blank">holger@merlinux.eu</a>&gt;</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>
&gt; Somehow i missed the point that it is possible to access the config object<br>
&gt; trough the metafunc argument of pytest_generate_tests when i first looked<br>
&gt; at the docs. Based on your recommendations i gave it another go, problem<br>
&gt; solved. Thanks for your feedback!<br>
&gt;<br>
&gt; There is however another problem now. There is a big difference in the<br>
&gt; order of configuration / test execution when deferring the setup of<br>
&gt; parametrized resources.<br>
&gt; When using the params argument of the pytest.fixture decorator the tests<br>
&gt; are run such that for a given config of the platform, all tests run after<br>
&gt; each other. This is what i want, since the config is time-consuming<br>
&gt; compared to running the tests. When using the pytest_generate_tests<br>
&gt; function to parameterize the platform fixture, the tests are run, such that<br>
&gt; one give tests is executed for all configs, than the next test for all<br>
&gt; selcted configs, and so on. Is there an easy way to change the ordering? Or<br>
&gt; should i implement my own ordering, maybe using<br>
&gt; pytest_collection_modifyitems?<br>
<br>
</div>If configs are a per-session thing (it sounds so), you should additionally<br>
pass &quot;scope=&#39;session&#39;&quot; to metafunc.parametrize(), which should effect<br>
the ordering you ask for. Other caching scope values are &#39;module&#39; or &#39;class&#39;<br>
but most often people use &#39;session&#39; and &#39;function&#39; (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>