Re: [Zope3-Users] Re: [Zope] Debugging doctests
On 2/23/06, Gary Poster <gary@zope.com> wrote:
You effectively can't step through all the tests (with a single pdb). You can step through a single line in the test well. While it sounds limiting, that has proved quite sufficient for me in practice. YMMV, of course.
Sigh. doctests really do suck. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
I dunno about sucking because they are quite good for documentation, but I tend to write plain-old unittests instead of doctests when I'm testing without any pretense towards writing documentation. If you test internals of a class in a doctest, the doctest body gets pretty cluttered, which tends to defeat the documentation-esque-ness of them. Being able to set a breakpoint in the test body is important for me too. I probably could be setting breakpoints once I'm in the debugger, but it's often easier to just stuff in a pdb.set_trace() before the line of code that I want to examine. And putting a set trace in a unittest is a natural thing to do, because you know the set trace will only get invoked once during a test run (as opposed to putting it right in the app code, where it might get invoked "by accident" through a different test). Setting breakpoints in unittest- tests is typically more fruitful than putting them in doctest-tests for the reasons that have been talked about in this thread. - C On Feb 23, 2006, at 11:27 AM, Lennart Regebro wrote:
On 2/23/06, Gary Poster <gary@zope.com> wrote:
You effectively can't step through all the tests (with a single pdb). You can step through a single line in the test well. While it sounds limiting, that has proved quite sufficient for me in practice. YMMV, of course.
Sigh. doctests really do suck.
-- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On 2/23/06, Chris McDonough <chrism@plope.com> wrote:
I dunno about sucking because they are quite good for documentation,
Oh, absolutely.
but I tend to write plain-old unittests instead of doctests when I'm testing without any pretense towards writing documentation.
Exactly my sentiments.
Being able to set a breakpoint in the test body is important for me too. I probably could be setting breakpoints once I'm in the debugger
Well, how do you set a breakpoint in something which has no py-file and line, but is in a text-document or string? :-) Not to mention, doctests are not debuggable from WingIDE. ;-) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
On Thursday 23 February 2006 13:37, Lennart Regebro wrote:
Not to mention, doctests are not debuggable from WingIDE.
Maybe we should have a WingIDE sprint in Boston at some point. This would be a good topic. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training
On 2/23/06, Stephan Richter <srichter@cosmos.phy.tufts.edu> wrote:
On Thursday 23 February 2006 13:37, Lennart Regebro wrote:
Not to mention, doctests are not debuggable from WingIDE.
Maybe we should have a WingIDE sprint in Boston at some point. This would be a good topic.
Let's do this somewhere I can get to without having to cross the Atlantic; Pareto will be far more likely to pay for my presence that way.. -- Martijn Pieters
On 2/23/06, Lennart Regebro <regebro@gmail.com> wrote:
Not to mention, doctests are not debuggable from WingIDE. ;-)
In 2.1 you can; the following is the equivalent of pdb.set_trace(): wingdbstub.debugger.Break() :) -- Martijn Pieters
On 2/24/06, Martijn Pieters <mj@zopatista.com> wrote:
On 2/23/06, Lennart Regebro <regebro@gmail.com> wrote:
Not to mention, doctests are not debuggable from WingIDE. ;-)
In 2.1 you can; the following is the equivalent of pdb.set_trace():
wingdbstub.debugger.Break()
:)
Oh, cool. I need to get 2.1. :) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
participants (4)
-
Chris McDonough -
Lennart Regebro -
Martijn Pieters -
Stephan Richter