[TIP] Test discovery for unittest

Marius Gedminas marius at gedmin.as
Sun Apr 5 04:38:52 PDT 2009


On Sat, Apr 04, 2009 at 09:18:36AM +0200, holger krekel wrote:
> Huh?  There is nothing in nose or py.test that prevents your from 
> doing all the compilcated inheritance trees you'd like to do. 
> Both can also run unittest.py style files.  

That turned out not to be the case in my experience.  I was working on
Pylons-based project where the team wanted to use py.test instead of
nose.  We had to make changes to the test suite (specifically, make the
classes inherit object instead of unittest.TestCase) to get them to
work with py.test (and move four lines of code from the Pylons Nose
plugin into the base test class, which is not py.tests's fault ;).

It could be related to the decision to use py.test 1.0.0 alpha (some svn
snapshot).

And, also (IIRC) rename the setUp methods to setup_method and change the
signature to accept one extra argument.  I don't know if that was
necessary, or just something done to match the style of the other test
suites in the existing parts of the (non-Pylons) codebase.

Marius Gedminas
-- 
What goes up, must come down. Ask any system administrator.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20090405/e59fd7c7/attachment.pgp 


More information about the testing-in-python mailing list