nose-devs/nose2 — pull request #4 by jpellerin (2012-01-04 22:37:54+00:00)
Title: Plugin api skeleton

In fact, a bit more than a skeleton: this diff brings this nose2 up to rough parity with the version of nose2 that depends on the plugins branch of unittest2. It does so without building much into the core beyond event dispatch -- almost all of the brains are in plugins, including all test loading and result handling. And supports python 2.6-3.2 and pypy with no translation/build step.

There were sacrifices along the way.

* Supporting pythons older than 2.6 is not practical due to the except: clause changes.

* The plugin api is very similar to unittest2/plugins', but not the same. Some event names and attributes are different and some hooks are different, new, or absent. Much of that is due to changing from a global hooks registry and global config as in the plugins branch to a config session with no global anything. Some other changes are due to the fact that not being unittest, nose2 can't replace TestCase and I'm not willing to go down the nose path of wrapping it -- so there are some things we just can't do (like provide exc_info in the event sent to stopTest).

* The result output system is also very, very different from what's in vanilla or plugins unittest2, because (like nose's) those result output systems are IMO really broken.

* Test discovery, while based on what's in the plugins branch of unittest2, has been substantially rewritten to correctly handle more cases, be easier to follow, and to work with the event/hook changes here.

* Documentation has not been updated, nor has the plugin doc generating sphinx extension.

* Many basic plugins (like output buffering, coverage, profiling, xunit, ... ) are missing.

* I haven't yet tried to do anything like multiprocess or py-execnet, which will be the true test of how robust this all is.

But all in all I think this is a good direction for nose2 -- the plugin api is worlds better than nose's, and the level of complexity and munginess in the code is far lower.

Comments? I'd like to merge this in within 2 weeks, if this is the direction we want to go.