nose-devs/nose — Issue #252: Plugin generative method exceptions swallowed
Author: jpellerin
Created: 2011-12-14 16:05:24+00:00
State: closed

What steps will reproduce the problem?

See test in the attached patch (the extra examples in the existing .rst
doctest file). It fails if the rest of the patch is not applied.

What version of the product are you using? On what operating system?

http://python-nose.googlecode.com/svn/branches/0.10.0-stable revision 419

Please provide any additional information below.

The problem is with TypeErrors and AttributeErrors that occur when the
generative method is actually generating test cases. When those exceptions
occur in the first call, they are already caught and logged as Failures
(the first call is the one that either runs the method, if it's not
actually a generator, or returns the generator object, if it is). When
they occur in subsequent calls, they are caught, but not logged as
Failures. Also, a couple of generative methods do not catch exceptions at
all, which can cause nose to crash.

I was able to get rid of some exception handling from nose.loader, since
the Failures from generative methods can be handled in one place, in
manager.PluginProxy.generate().

Note that I created module nose.failure to avoid a circular import --
perhaps other people will want to change the details here, especially since
this breaks the public API. I also skimped on a module docstring for
nose.failure, because I'm expecting other people to complain and change
this anyway ;-)

Google Code Info:
Issue #: 152
Author: j...@pobox.com
Created On: 2008-01-27T00:36:30.000Z
Closed On: 2008-01-29T01:54:51.000Z