[Zope-dev] zope.testing.testrunner.debug.post_mortem and try/finally

Marius Gedminas marius at gedmin.as
Wed Dec 2 17:06:03 EST 2009


On Wed, Dec 02, 2009 at 01:36:37PM -0500, Benji York wrote:
> Here's another idea: a testrunner option that takes a file name and line
> number and inserts a breakpoint at that position.  That way you can get
> the same effect as editing the code without actually having to do so.

Is that possible?  I once spent hours studying pdb docs and found no way
to set a breakpoint in advance, without modifying the source file in
question, and without having the user to do manual interaction at the
beginning.

The closest that I can come is

    import pdb
    dbg = pdb.Pdb()
    dbg.set_break(filename, lineno)
    dbg.runcall(entry_point)

but this breaks into the pdb prompt at once, without waiting for the
breakpoint to get triggered, and I have to manually 'c' to get unstuck.

What am I missing?

Marius Gedminas
-- 
http://pov.lt/ -- Zope 3 consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20091203/4a397cb7/attachment.bin 


More information about the Zope-Dev mailing list