Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8779

Re: Help for Python mock test suite needed

From Barry Warsaw <barry@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: Help for Python mock test suite needed
Date 2016-08-17 15:30 +0200
Message-ID <s794R-1zw-9@gated-at.bofh.it> (permalink)
References (5 earlier) <s5WW6-45C-1@gated-at.bofh.it> <s68Xg-3DL-19@gated-at.bofh.it> <s6mQx-3Wz-5@gated-at.bofh.it> <s6wGd-1PM-15@gated-at.bofh.it> <s77FM-wB-7@gated-at.bofh.it>
Organization The Organization of Unorganized Woozalists

Show all headers | View raw


On Aug 17, 2016, at 01:58 PM, Andreas Tille wrote:

>This exactly was my question:  Is there any advise how to inject
>sensible debugging code or any other strategies to find out what might
>be the problem.
>
>> So you can use the full power of your development environment to hunt
>> the problem: an interactive debugging session, etc. Use your Python
>> skills :-)  
>
>I'm afraid at first I need to enhance my Python skills ...

pdb is debugging 101: https://docs.python.org/3/library/pdb.html

Specifically, add this line to the code at the point where you want to start
inspecting the state of the program:

    import pdb; pdb.set_trace()

Now run the test suite and when you hit the breakpoint, you can print values,
inspect object, step through calls, etc.  It may or may not help you solve the
problem, but you'll get a much better sense of what's actually going on, and
it should at least improve the quality of an upstream bug report.

Cheers,
-Barry

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Help for Python mock test suite needed (Was: Any help with problem  of srst2 new versions tests suite failing to call bowtie2) Andreas Tille <andreas@an3as.eu> - 2016-08-13 08:50 +0200
  Re: Help for Python mock test suite needed (Was: Any help with problem of srst2 new versions tests suite failing to call bowtie2) Scott Kitterman <debian@kitterman.com> - 2016-08-13 18:50 +0200
    Re: Help for Python mock test suite needed (Was: Any help with  problem of srst2 new versions tests suite failing to call bowtie2) Andreas Tille <andreas@an3as.eu> - 2016-08-14 00:30 +0200
      Re: Help for Python mock test suite needed Ben Finney <ben+debian@benfinney.id.au> - 2016-08-14 02:50 +0200
        Re: Help for Python mock test suite needed Andreas Tille <andreas@an3as.eu> - 2016-08-14 08:20 +0200
          Re: Help for Python mock test suite needed Ben Finney <ben+debian@benfinney.id.au> - 2016-08-14 21:10 +0200
            Re: Help for Python mock test suite needed Andreas Tille <andreas@an3as.eu> - 2016-08-15 12:00 +0200
              Re: Help for Python mock test suite needed Ben Finney <ben+debian@benfinney.id.au> - 2016-08-15 22:30 +0200
                Re: Help for Python mock test suite needed Andreas Tille <andreas@an3as.eu> - 2016-08-17 14:00 +0200
                Re: Help for Python mock test suite needed Barry Warsaw <barry@debian.org> - 2016-08-17 15:30 +0200

csiph-web