[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help for Python mock test suite needed



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


Reply to: