Noob in Python. Problem with fairly simple test case

Larry Hudson orgnut at yahoo.com
Thu Jul 16 05:01:46 CEST 2015


On 07/15/2015 05:11 AM, Chris Angelico wrote:
> On Wed, Jul 15, 2015 at 9:44 PM, Jason P. <suscricions at gmail.com> wrote:
>> I can't understand very well what's happening. It seems that the main thread gets blocked listening to the web server. My intent was to spawn another process for the server independent of the test. Obviously I'm doing something wrong. I've made several guesses commenting pieces of code (tearDown method for example) but I didn't manage to solve the problem(s).
>>
>
> When you find yourself making guesses to try to figure out what's
> going on, here are two general tips:
>
> 1) Cut out as many pieces as you can. Test one small thing at a time.
> 2) If In Doubt, Print It Out! Stick print() calls into the code at key
> places, displaying the values of parameters or the results of
> intermediate calculations - or just saying "Hi, I'm still here and I'm
> running!".
>
In addition to using print(), in some places I like using input() instead, as in:
     input('x={}, y={} --> '.format(x, y))
Then the program stops at that point so you can study it.
To continue just press <Enter>, or Ctrl-C to abort.

      -=- Larry -=-



More information about the Python-list mailing list