Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debug': 0.07; 'extent': 0.07; 'statements': 0.09; 'subject:test': 0.09; 'subject:How': 0.10; 'bug': 0.12; 'question.': 0.14; 'faq,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'handlers': 0.16; 'handlers.': 0.16; 'personally,': 0.16; 'roy': 0.16; 'run-time).': 0.16; 'stderr': 0.16; 'subject:run': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'bit': 0.19; 'module': 0.19; 'not,': 0.20; 'aug': 0.22; 'certainly': 0.24; 'logging': 0.26; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'asked': 0.31; 'code': 0.31; 'getting': 0.31; 'becomes': 0.33; 'maybe': 0.34; "i'd": 0.34; "can't": 0.35; 'something': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'so,': 0.37; 'turn': 0.37; 'two': 0.37; 'ends': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'times': 0.62; "you've": 0.63; 'places': 0.64; 'different': 0.65; 'smith': 0.68; 'console,': 0.84; 'hassle.': 0.84; 'subject:times': 0.84; '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; bh=5bDKxYvnpoTMhA6g/0HTzP4fODsV6Aaxt6WUIk78mtE=; b=YYjZBfpykQR5IDJ5P1ai9rUrtNQGjLaneL0/oLtFGkn6bOuyv8MMb1WNyfUqAhWQlg sURf0BMDOGwTUUMztu3konMGOuuSgQOkMdLECwWAeQauWf+KQLangXLZlUwZiGplpmkJ pGd1aqFy0u7EIsEDeHuOm5Htz3Z18+psDTnMykbckRCgvBpi7cOQ/Qr/oifaYN0Mm0rp mu6vbQj8naQmX6dzeKlKZ265ryS2xx8mrkJQ/XSmH5xao8jGFnjGLiEhBroWZD8d+Bcp TmrFELNys6j9uBZY3mJLc97lbxegvsKQA5ZxNzdMIbgx2mlG18V7Rm6d6YxNcq6Lg1XK Qm7w== MIME-Version: 1.0 X-Received: by 10.220.182.193 with SMTP id cd1mr3470766vcb.32.1376176895715; Sat, 10 Aug 2013 16:21:35 -0700 (PDT) In-Reply-To: References: <35d12db6-c367-4a45-a68e-8ed4c0ae1ee7@googlegroups.com> Date: Sun, 11 Aug 2013 00:21:35 +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 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1376176897 news.xs4all.nl 15927 [2001:888:2000:d::a6]:37960 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52334 On Sun, Aug 11, 2013 at 12:14 AM, Roy Smith wrote: > Maybe you've got two different handlers which are both getting the same > logging events and somehow they both end up in your stderr stream. > Likely? Maybe not, but if you don't have any logging code in the test > at all, it becomes impossible. You can't have a bug in a line of code > that doesn't exist (yeah, I know, that's a bit of a handwave). Likely? Very much so, to the extent that it is, if not a FAQ, certainly a Not All That Uncommonly Asked Question. So many times someone places logging code in something that gets called twice, and ends up with two handlers. Personally, I much prefer to debug with straight-up 'print' - much less hassle. I'd turn to the logging module only if I actually need its functionality (logging to some place other than the console, or leaving the log statements in and {en|dis}abling them at run-time). ChrisA