[TIP] unittest2 and the future of nose
kumar.mcmillan at gmail.com
Thu Mar 4 13:14:45 PST 2010
On Thu, Mar 4, 2010 at 2:51 PM, jason pellerin <jpellerin at gmail.com> wrote:
> Fact: unittest2 is coming:
> ... indeed, it's already here (just not yet in stdlib). It does test
> discovery (though not by default), can support test functions (though
> not by default), will eventually support a better form of
> parameterized tests than nose does, and also will eventually support
> at least class and module-level fixtures.
> Which means it's not going to happen unless enough of you folks are
> interested and have time to commit.
> What do you think?
My gut reaction to all this is that unittest2 probably replaces most
of Nose's functionality besides plugin support. I say gut reaction
because I would need to think about it harder and dig into unittest2
deeper to be sure.
That said, one HUGE win for unittest2 would be if it could support
Nose's plugin API. In fact, most of the "features" in Nose are
implemented as plugins. From Nose's source, here are the builtin
plugins (to give you an idea) :
These are all documented here:
So, if someone implements Nose's plugin interface in unittest2 you
might just get all those for free! There are definitely some warts in
the plugin API though. One area is output capturing and redirection,
another is error handling, there are probably others. Otherwise the
API is pretty straightforward, you get a hook for most of anything you
ever need to do with test data:
The only part of Nose that is not implemented as a plugin that is not
scheduled to be supported by unittest2 (yet) is config file support (I
think?). You can turn on any command line option in a config file
which is really crucial for projects that depend on a lot of plugins:
More information about the testing-in-python