[TIP] pytest and nose - what's to choose between them?

Chris Withers chris at simplistix.co.uk
Fri Aug 30 10:39:30 PDT 2013

On 13/08/2013 19:07, Barry Warsaw wrote:
> For example, I can't really use the doctest plugin because of
> https://github.com/nose-devs/nose/issues/594

Just use Manuel and be done with it :-)

> On the positive side, I've had to change almost nothing about the structure of
> my existing tests to migrate to nose.  My existing fixtures mostly work,
> although I did have to do some reorganization to work around the assumptions
> imposed by zc.testing's layer arrangement.  Instead of using layers, I now use
> a base class.

The layers problems is a complex one, Robert Collins' testresources 
package is another take on this.

> One thing I really like about nose is the ability to write a plugin that
> executes some code before the tests begin.  I had an ugly hack to do this in
> zc.testing/zc.buildout but now I just add a begin() method to my plugin and it
> does all the pre-initialization I need.

Yep, love the plugin framework :-)

That said, as a point of principle, I try and write tests that can be 
run with any runner: nose, zc.testing, unittest2. I think some of the 
features of pytest prevent that being possible which has kept me from 
looking at it...


Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk

More information about the testing-in-python mailing list