Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.044 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'subject:Python': 0.06; 'difference,': 0.09; 'subject:method': 0.09; 'cc:addr:python- list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:issue': 0.16; 'there?': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'trying': 0.19; 'help.': 0.21; 'command': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'instance,': 0.24; 'cc:2**0': 0.24; 'code:': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'sep': 0.31; 'except': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'i.e.': 0.36; 'method': 0.36; 'should': 0.36; 'example,': 0.37; 'being': 0.38; 'issue': 0.38; 'explain': 0.39; 'either': 0.39; 'how': 0.40; 'remove': 0.60; "you're": 0.61; 'first': 0.61; "you'll": 0.62; 'fire': 0.65; 'spot': 0.65; 'here': 0.66; 'cut': 0.74; 'to:none': 0.92; 'yourself,': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=0bU428Oe+WdWL1S2OxqtHik5jnjT1gSqCutezAp/+3I=; b=vt/8osvUVbPb6caZRHw2j0zpPQSdeG6ElwIeAjDZ8njcbZKcXlv9IpjUUH8l07HZd7 uwHL7kiSrkPrZnJUpkWm5SUesFF/q10Mgr0h2oZaUcKA34TFb/yUk1NmYmMeMqJPLjNv y3l61D2bPrW0gFQZ0wilXlC9rQ3LLrtlOQP2YYumJhI35wQCxD7KSCNbG5SS8B1r0OEk 36//kjqiPsaq3L7M3q+dKHJnWY0jKljbz/Kj0JeD2JXT5jaPH856lw54r7IFE0tTee1c AYzDjfgvCqrOWOAYpdGVEEMHgUxuJ5Ta2vtB4FJrqi3jqpT8Nggk+8HrcBguGbyrF9q4 jeAA== MIME-Version: 1.0 X-Received: by 10.50.117.65 with SMTP id kc1mr42414509igb.34.1411861355528; Sat, 27 Sep 2014 16:42:35 -0700 (PDT) In-Reply-To: References: Date: Sun, 28 Sep 2014 09:42:35 +1000 Subject: Re: Python unittesting method call issue From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1411861358 news.xs4all.nl 2863 [2001:888:2000:d::a6]:39970 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78422 On Sun, Sep 28, 2014 at 9:25 AM, Milson Munakami wrot= e: > I am trying to set the precondition for the test first prior to test othe= r test cases. But as you can see in my code the precondition print command = is not fired! Can you explain the cause and solution how to fire the code w= ith in that method i.e. SetPreConditionFirewall() with setup variable self.= in this fucntion. Here is my code: > The first thing to do is to cut down your code - for instance, what happens if you remove the urlopen call and just have the print in there? (And while you're at it, I think suite() is completely superfluous.) You should be able to get your code down to being identical to a working example, except for one difference, and then you'll be able to either spot the issue yourself, or ask for very specific help. ChrisA