[TIP] Custom execution of nose tests

jason pellerin jpellerin at gmail.com
Wed Jul 20 18:32:33 PDT 2011

That's a fun one. Do you want to wait for cpython to execute each
test, or send a bunch of tests over to process/process pool and
collect the results later?

The wait case is not so hard -- you can write a plugin that implements
prepareTestCase* to wrap the test in the cpythonizing machinery, run
it, and report the result.

The queue and collect case is sort of a special case of
multiprocessing which requires writing a new test runner and is
harder. But basically you write whatever test runner you want and use
the prepareTestRunner** plugin hook to inject it.

Also we really need to add pypy to our tox config, Kumar. ;)


*  http://packages.python.org/nose/plugins/interface.html#nose.plugins.base.IPluginInterface.prepareTestCase


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

More information about the testing-in-python mailing list