testing-cabal/testtools — pull request #66 by thomir (2013-11-26 04:29:53+00:00)
Title: Add testtools.StacktraceContent.

This PR creates the StacktraceContent class. It simply creates a StackLinesContent object based on the current frame stack (the other function that uses StackLinesContent is TracebackContent, which does a similar thing, but for an exception traceback).

The use case is for the delayed assertion code, where we want to add a stack trace as a detail of a test every time a delayed assertion happens, so the user can see on which lines something went wrong.

I'm looking for some feedback on this one. In particular I'd like some input on how to test this. Creating a fake stack trace is a lot harder in this case, since creating mock frame objects is a real pain (and in any way I can't really see whjy you'd ever want to pass in a stack object...).

I've tested the things I can think of with automated tests, and tested the rest manually, but I'd love to improve that situation.