Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52334

Re: How many times does unittest run each test?

References <f7b24010-f3f4-4e86-b6c4-9ddb503d0412@googlegroups.com> <roy-FE5D5B.16404310082013@news.panix.com> <35d12db6-c367-4a45-a68e-8ed4c0ae1ee7@googlegroups.com> <roy-E25FCE.19140910082013@news.panix.com>
Date 2013-08-11 00:21 +0100
Subject Re: How many times does unittest run each test?
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.444.1376176897.1251.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, Aug 11, 2013 at 12:14 AM, Roy Smith <roy@panix.com> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How many times does unittest run each test? Josh English <Joshua.R.English@gmail.com> - 2013-08-10 13:00 -0700
  Re: How many times does unittest run each test? Roy Smith <roy@panix.com> - 2013-08-10 16:40 -0400
    Re: How many times does unittest run each test? Josh English <Joshua.R.English@gmail.com> - 2013-08-10 15:53 -0700
      Re: How many times does unittest run each test? Roy Smith <roy@panix.com> - 2013-08-10 19:14 -0400
        Re: How many times does unittest run each test? Chris Angelico <rosuav@gmail.com> - 2013-08-11 00:21 +0100
          Re: How many times does unittest run each test? Josh English <Joshua.R.English@gmail.com> - 2013-08-10 17:52 -0700
            Re: How many times does unittest run each test? Chris Angelico <rosuav@gmail.com> - 2013-08-11 02:10 +0100
        Re: How many times does unittest run each test? Josh English <Joshua.R.English@gmail.com> - 2013-08-10 17:47 -0700
    Re: How many times does unittest run each test? Josh English <joshua.r.english@gmail.com> - 2013-08-10 15:58 -0700
    Re: How many times does unittest run each test? Ned Batchelder <ned@nedbatchelder.com> - 2013-08-10 18:52 -0400

csiph-web