[TIP] Asserting behaviour of exception tracebacks
Pete
pfein at pobox.com
Thu Jan 31 05:14:19 PST 2008
On Thursday January 31 2008 7:35:52 am Ben Finney wrote:
> What I don't know how to do is make a simple assertion about a
> traceback object to find the exception that originally caused it, and
> compare it against the original exception object that the unit test
> rigged to happen.
IIRC, there are ways of extracting a stack frame from a traceback; you could
then do whatever sort of poking at the stack frames. Though as Michael
notes, textifying sounds less hurty.
--
Peter Fein || 773-575-0694 || pfein at pobox.com
http://www.pobox.com/~pfein/ || PGP: 0xCCF6AE6B
irc: pfein at freenode.net || jabber: peter.fein at gmail.com
More information about the testing-in-python
mailing list