[TIP] pytest-2.0: asserts++, unittest++, reporting++, config++, docs++

holger krekel holger at merlinux.eu
Fri Nov 26 15:31:55 PST 2010


On Fri, Nov 26, 2010 at 09:41 -0800, Phlip wrote:
> > The current incarnation of assert re-interpretation involves
> > a second evaluation of the assert expression and
> > specifying a message avoids this.
> 
> When I use Django and something crashes in development mode, the views
> return a stack trace. When you click on a line in the trace, it
> expands into a quickwatch of all the variable names and values in one
> stack frame.
> 
> Where is Python getting that from, and can't you use it?

It comes from Python frame objects. And yes, you can use "py.test -l" to show
local variables. Or "--pdb" to start an interactive debugger.  If there were a
web interface you could probably click on it and see variable names and values
:)

> (All of these topics go under the category "test-driven development
> must be _more_ powerful than debugging, at all times, and in all
> layers & situations. Anything debugging can do, TDD can do better!")

Heh, i am often debugging failing tests :)

cheers,
holger



More information about the testing-in-python mailing list