Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debugging': 0.07; 'differently': 0.07; 'suddenly': 0.07; '"if': 0.09; 'calls.': 0.09; 'debugger': 0.09; 'occasionally': 0.09; 'statements': 0.09; 'subject:test': 0.09; 'subject:How': 0.10; 'clauses.': 0.16; 'debugging,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'function?': 0.16; 'simple.': 0.16; 'so)': 0.16; 'subject:run': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'aug': 0.22; 'print': 0.22; 'issue,': 0.24; 'sort': 0.25; 'logging': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'gives': 0.31; 'code': 0.31; 'lines': 0.31; 'usually': 0.31; 'josh': 0.31; 'run': 0.32; 'actual': 0.34; 'tool': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'really': 0.36; 'module.': 0.36; 'subject:?': 0.36; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'to:addr:python.org': 0.39; "you're": 0.61; "you'll": 0.62; 'obvious': 0.74; 'other.': 0.75; 'activated': 0.84; 'message"': 0.84; 'subject:times': 0.84; 'probe': 0.91; '2013': 0.98 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:to :content-type:content-transfer-encoding; bh=63dniFSw6GSdtbtv4v+84UEiyMxKQgxWDNdyTbC2M7Y=; b=CVmk6GHkZYPJjCH0pL6I8K8xhu4/H7+m3N6NiUoTOUwUvsq5lNA8jRywVqTPILkcTn /jEYRWLzyw4xOsRxvN1yTdYR1TxJ+ZluGd2/o7F7Xfp8tMVLGiRf/69woS0rbCfxMV1K RSpJt6aCDItzOY80xtYKw081RaoOBZjtS9zxkzEhmNoO0ueajj7AjYqPXp3k38H4oVR7 Vjl2RixeL5BMV4eFyGaO86mfcnnW9RWhf54qsiy/PHSEsn54UQix4YuOIesAheBClu6R K4R54184JomGVamsqZtHuKe6qeS1PPcTrNAzC1Naw7mPBbwz2e+u0Lk3RpErMfjbXfmH F9rQ== MIME-Version: 1.0 X-Received: by 10.58.214.105 with SMTP id nz9mr3552859vec.58.1376183430169; Sat, 10 Aug 2013 18:10:30 -0700 (PDT) In-Reply-To: <1d4f1667-9234-403a-b33d-f6636f081c72@googlegroups.com> References: <35d12db6-c367-4a45-a68e-8ed4c0ae1ee7@googlegroups.com> <1d4f1667-9234-403a-b33d-f6636f081c72@googlegroups.com> Date: Sun, 11 Aug 2013 02:10:30 +0100 Subject: Re: How many times does unittest run each test? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376183432 news.xs4all.nl 15944 [2001:888:2000:d::a6]:36245 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52340 On Sun, Aug 11, 2013 at 1:52 AM, Josh English wrote: > I'm using logging for debugging, because it is pretty straightforward and= can be activated for a small section of the module. My modules run long (3= ,000 lines or so) and finding all those dastardly print statements is a pai= n, and littering my code with "if debug: print message" clauses. Logging ju= st makes it simple. So logging might be the right tool for your job. Tip: Sometimes it helps, when trying to pin down an issue, to use an additional debugging aid. You're already using logging? Add print calls. Already got a heartbeat function? Run it through a single-stepping debugger as well. Usually that sort of thing just gives you multiple probes at the actual problem, but occasionally you'll get an issue like this, and suddenly it's really obvious because one probe behaves completely differently from the other. ChrisA