<html><head></head><body bgcolor="#FFFFFF"><div><br><br>On Nov 25, 2011, at 7:27 AM, John Anderson &lt;<a href="mailto:sontek@gmail.com">sontek@gmail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote">

</div></blockquote><div><br></div></div></div><div>Hi John,&nbsp;</div><div><br></div><div>This is a similar problem that the Pecan [0] framework had (still?) for exposing configuration setup for the actual application</div><div>
at test time.</div>

<div><br></div><div>The problem is (as you suspect) that the configuration in pytest_configure happens *before* any of the mechanisms for coverage start.</div><div><br></div><div>My suggestion would be not to use this and to try and have a base class that you can use for your tests that include this configuration and</div>


<div>database setup.&nbsp;</div></div></blockquote><div><br></div><div>The problem is I only want to run this once for *all* my tests, just to start in a clean slate. &nbsp;I don't want to run it per sets of test. &nbsp; It *does* work if I put it in setUpClass of my Base test class but it takes my tests from 5sec to 30sec because its dropping and recreating the db for each set of tests.</div>
</div>
</div></blockquote><div><br></div><div>FWIW, you should be able to define setUpModule() in each test module you want this per-run support in. Obviously not a perfect solution given the duplication, but better than 6x slow down!</div><div><br></div><div>-Tom</div><br><blockquote type="cite"><div><span>_______________________________________________</span><br><span>testing-in-python mailing list</span><br><span><a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a></span><br><span><a href="http://lists.idyll.org/listinfo/testing-in-python">http://lists.idyll.org/listinfo/testing-in-python</a></span><br></div></blockquote></body></html>