Sorry, I should have been more clear, I understand it&#39;s supposed to return a callable, I just need to understand what exactly that callable is supposed to do, essentially, is there an example of what the &quot;default&quot; prepareTestCase does?  Also, returning None simply triggers the default behavior, right?<div>
<br></div><div>Alex<br><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 10:33 PM, Kumar McMillan <span dir="ltr">&lt;<a href="mailto:kumar.mcmillan@gmail.com">kumar.mcmillan@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Jul 20, 2011 at 11:46 PM, Alex Gaynor &lt;<a href="mailto:alex.gaynor@gmail.com">alex.gaynor@gmail.com</a>&gt; wrote:<br>
&gt; Err, are there any docs with an example of what prepareTestCase should<br>
&gt; return?<br>
<br>
</div>Hi Alex.  prepareTestCase just needs to return a callable.  When<br>
called, it runs the test.  You can also look at nose.case.Test.  A<br>
subclass of that would be an adequate return value.<br>
<br>
As an aside, you may want to check out nosepipe, a plugin that<br>
collects tests then runs each one in a subprocess:<br>
<a href="http://pypi.python.org/pypi/nosepipe/" target="_blank">http://pypi.python.org/pypi/nosepipe/</a>  It&#39;s not an elegant solution to<br>
what you&#39;re after but probably implements a lot of the same hooks.<br>
<font color="#888888"><br>
-Kumar<br>
</font><div><div></div><div class="h5"><br>
<br>
&gt; Thanks,<br>
&gt; Alex<br>
&gt;<br>
&gt; On Wed, Jul 20, 2011 at 9:16 PM, Alex Gaynor &lt;<a href="mailto:alex.gaynor@gmail.com">alex.gaynor@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Synchronous, normal style is totally fine, so it looks like<br>
&gt;&gt; prepareTestCase is the right call.  Thanks.<br>
&gt;&gt; Alex<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Jul 20, 2011 at 6:32 PM, jason pellerin &lt;<a href="mailto:jpellerin@gmail.com">jpellerin@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; That&#39;s a fun one. Do you want to wait for cpython to execute each<br>
&gt;&gt;&gt; test, or send a bunch of tests over to process/process pool and<br>
&gt;&gt;&gt; collect the results later?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The wait case is not so hard -- you can write a plugin that implements<br>
&gt;&gt;&gt; prepareTestCase* to wrap the test in the cpythonizing machinery, run<br>
&gt;&gt;&gt; it, and report the result.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The queue and collect case is sort of a special case of<br>
&gt;&gt;&gt; multiprocessing which requires writing a new test runner and is<br>
&gt;&gt;&gt; harder. But basically you write whatever test runner you want and use<br>
&gt;&gt;&gt; the prepareTestRunner** plugin hook to inject it.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Also we really need to add pypy to our tox config, Kumar. ;)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; JP<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; *<br>
&gt;&gt;&gt;  <a href="http://packages.python.org/nose/plugins/interface.html#nose.plugins.base.IPluginInterface.prepareTestCase" target="_blank">http://packages.python.org/nose/plugins/interface.html#nose.plugins.base.IPluginInterface.prepareTestCase</a><br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt; **<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href="http://packages.python.org/nose/plugins/interface.html#nose.plugins.base.IPluginInterface.prepareTestRunner" target="_blank">http://packages.python.org/nose/plugins/interface.html#nose.plugins.base.IPluginInterface.prepareTestRunner</a><br>

&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Wed, Jul 20, 2011 at 9:15 PM, Alex Gaynor &lt;<a href="mailto:alex.gaynor@gmail.com">alex.gaynor@gmail.com</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt; &gt; Hi all,<br>
&gt;&gt;&gt; &gt; I&#39;ve got a fair insane question about nose.  I&#39;d like to be able to<br>
&gt;&gt;&gt; &gt; control<br>
&gt;&gt;&gt; &gt; how my nose tests are executed, specifically I&#39;m running my suite under<br>
&gt;&gt;&gt; &gt; PyPy, but I&#39;d like certain tests (in their entirety, setup, test,<br>
&gt;&gt;&gt; &gt; teardown)<br>
&gt;&gt;&gt; &gt; to be executed on CPython.  I have the machinery to send some code over<br>
&gt;&gt;&gt; &gt; to<br>
&gt;&gt;&gt; &gt; CPython to execute it, but what I&#39;m missing is the ability to do that<br>
&gt;&gt;&gt; &gt; over<br>
&gt;&gt;&gt; &gt; the entirety of a test run.  In py.test I believe this could be<br>
&gt;&gt;&gt; &gt; accomplished<br>
&gt;&gt;&gt; &gt; with a custom test collector.<br>
&gt;&gt;&gt; &gt; Thanks,<br>
&gt;&gt;&gt; &gt; Alex<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; --<br>
&gt;&gt;&gt; &gt; &quot;I disapprove of what you say, but I will defend to the death your<br>
&gt;&gt;&gt; &gt; right to<br>
&gt;&gt;&gt; &gt; say it.&quot; -- Evelyn Beatrice Hall (summarizing Voltaire)<br>
&gt;&gt;&gt; &gt; &quot;The people&#39;s good is the highest law.&quot; -- Cicero<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; _______________________________________________<br>
&gt;&gt;&gt; &gt; testing-in-python mailing list<br>
&gt;&gt;&gt; &gt; <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt;&gt;&gt; &gt; <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; &quot;I disapprove of what you say, but I will defend to the death your right<br>
&gt;&gt; to say it.&quot; -- Evelyn Beatrice Hall (summarizing Voltaire)<br>
&gt;&gt; &quot;The people&#39;s good is the highest law.&quot; -- Cicero<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; &quot;I disapprove of what you say, but I will defend to the death your right to<br>
&gt; say it.&quot; -- Evelyn Beatrice Hall (summarizing Voltaire)<br>
&gt; &quot;The people&#39;s good is the highest law.&quot; -- Cicero<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; testing-in-python mailing list<br>
&gt; <a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt; <a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>&quot;I disapprove of what you say, but I will defend to the death your right to say it.&quot; -- Evelyn Beatrice Hall (summarizing Voltaire)<br>&quot;The people&#39;s good is the highest law.&quot; -- Cicero<br>
<br>
</div>