Re: zope.testing.testrunner.debug.post_mortem and try/finally
Benji York <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Dec 2, 2009 at 1:22 PM, Ross Patterson <[email protected]> wrote: > I'm sorry, I was unclear, the try/finally clauses are not necessarily in > *test tearDown* methods (though I used that language), they are often a > part of the application being tested, such as closing the request, > closing DB connections, or aborting transactions. In those situations I just edit the code and put a "import pdb;pdb.set_trace()" at the top of the finally: block and re-run the test. It is an interesting idea to provide some way to make that automatic. Maybe a settrace hook that will invoke pdb at the top of every finally clause that is encountered, somewhat similar to the -D option. You might end up getting way too many false positives though. 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. -- Benji York _______________________________________________ Zope-Dev maillist - [email protected] https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )