Comment 5 for bug 501169

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 501169] Re: testtools should pass the real exc_info to TestResult methods

On Tue, 2009-12-29 at 08:24 +0000, Martin [gz] wrote:
> I think there is (and should be) be a requirement that just after a test
> finishes, the test framework has access to the actual exception raised
> and the traceback object. It might be there's some way of achieving this
> with testtools currently, but it's not obvious to me how if so.

There isn't really such a requirement in unittest proper. Can you
enlarge on why you feel strongly about this - what it will do for you,
and how you see that working with remoted tests (those in different
languages, on different machines, or simply in different processes (e.g.
via the multiprocessing module).

> This isn't just about the current stringification in testtools being
> broken compared to plain unittest or the old bzrlib test code. Access to
> the real traceback object, not just a (lossy) text representation,
> allows a bunch of extra things you can do by grovelling around the
> stack.

I've had a fairly serious look around other test frameworks (in other
languages too) and not seen any doing that other than py.test, which
does it during assert, not during reporting of the activity.

As I've said though, I'm open to making it possible *when possible*, but
I feel very strongly that it must be an optional protocol not a required
behaviour.

-Rob