[TIP] pdb, coverage.py, etc... what's the right tool?

Dan Wandschneider daniel.wandschneider at schrodinger.com
Thu Jun 19 15:54:11 PDT 2014


Colin-
Probably pdb.  You can use pdb.set_trace() to start the debugger - it
sounds like you want to put this at the beginning of the function you're
debugging.  Please check the documentation for pdb
<https://docs.python.org/2/library/pdb.html>, which includes some examples.
 The "debugging in python"
<http://pythonconquerstheuniverse.wordpress.com/2009/09/10/debugging-in-python/>
article at
pythonconquerstheuniverse is also nice.


On Thu, Jun 19, 2014 at 12:00 PM, <testing-in-python-request at lists.idyll.org
> wrote:

> Send testing-in-python mailing list submissions to
>         testing-in-python at lists.idyll.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.idyll.org/listinfo/testing-in-python
> or, via email, send a message with subject or body 'help' to
>         testing-in-python-request at lists.idyll.org
>
> You can reach the person managing the list at
>         testing-in-python-owner at lists.idyll.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of testing-in-python digest..."
>
> Today's Topics:
>
>    1. pdb, coverage.py, etc... what's the right tool?
>       (Colin Kincaid Williams)
>
>
> ---------- Forwarded message ----------
> From: Colin Kincaid Williams <discord at uw.edu>
> To: testing-in-python at lists.idyll.org
> Cc:
> Date: Thu, 19 Jun 2014 00:51:12 -0700
> Subject: [TIP] pdb, coverage.py, etc... what's the right tool?
> Hi,
>
> I want to step through a python script with a main method and print
> out everything similar to what is displayed in an interactive python
> session. Print and use output redirection, or just write it to a file.
> I read on Stack Overflow that I would want to use coverage, but I
> didn't see this use case explicitly in it's docs. Right now I'm
> copying and pasting everything and it's really tedious. Is there an
> easy to use tool built for this?
>
> Regards,
>
> Colin Williams
>
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20140619/080060e7/attachment.htm>


More information about the testing-in-python mailing list