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


Groups > comp.lang.python > #57480

Re: Python Coverage: testing a program

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Python Coverage: testing a program
Date 2013-10-25 10:30 +1100
References (3 earlier) <526908b2$0$29981$c3e8da3$5496439d@news.astraweb.com> <52695CFB.9010309@nedbatchelder.com> <526984F3.3040905@udel.edu> <7weh7acrv8.fsf_-_@benfinney.id.au> <52699EFE.3070904@stoneleaf.us>
Newsgroups comp.lang.python
Message-ID <mailman.1489.1382657706.18130.python-list@python.org> (permalink)

Show all headers | View raw


Ethan Furman <ethan@stoneleaf.us> writes:

> On 10/24/2013 01:54 PM, Ben Finney wrote:
> > You can do this already with current Coverage: tell Coverage to
> > exclude <URL:http://nedbatchelder.com/code/coverage/excluding.html>
> > specific statements, and it won't count them for coverage
> > calculations.
>
> While that's neat (being able to exclude items) is there any reason to
> ever count the `if __name__ == '__main__'` clause?

I'd rather Coverage not go down the track of accumulating special cases
based on how they're written. A simple pragma fixes the problem, no
matter what the exact statement looks like.

-- 
 \           “Prediction is very difficult, especially of the future.” |
  `\                                                       —Niels Bohr |
_o__)                                                                  |
Ben Finney

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


Thread

Maintaining a backported module Steven D'Aprano <steve@pearwood.info> - 2013-10-24 04:54 +0000
  Re: Maintaining a backported module Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 16:09 +1100
    Re: Maintaining a backported module Metallicow <metaliobovinus@gmail.com> - 2013-10-23 22:46 -0700
      Re: Maintaining a backported module Metallicow <metaliobovinus@gmail.com> - 2013-10-30 03:32 -0700
  Re: Maintaining a backported module Paul Rubin <no.email@nospam.invalid> - 2013-10-23 22:38 -0700
  Re: Maintaining a backported module Ethan Furman <ethan@stoneleaf.us> - 2013-10-23 23:30 -0700
  Re: Maintaining a backported module Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 17:59 +1100
    Re: Maintaining a backported module Steven D'Aprano <steve@pearwood.info> - 2013-10-24 09:38 +0000
      Re: Maintaining a backported module Ben Finney <ben+python@benfinney.id.au> - 2013-10-24 21:01 +1100
  Re: Maintaining a backported module Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-10-24 09:00 +0200
  Re: Maintaining a backported module Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-24 09:37 +0100
  Re: Maintaining a backported module Ned Batchelder <ned@nedbatchelder.com> - 2013-10-24 06:36 -0400
    Re: Maintaining a backported module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-24 11:46 +0000
      Re: Maintaining a backported module rusi <rustompmody@gmail.com> - 2013-10-24 05:25 -0700
      Re: Maintaining a backported module Ned Batchelder <ned@nedbatchelder.com> - 2013-10-24 13:46 -0400
      Re: Maintaining a backported module Terry Reedy <tjreedy@udel.edu> - 2013-10-24 16:37 -0400
      Python Coverage: testing a program (was: Maintaining a backported module) Ben Finney <ben+python@benfinney.id.au> - 2013-10-25 07:54 +1100
      Re: Python Coverage: testing a program Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-24 22:55 +0100
      Re: Python Coverage: testing a program Terry Reedy <tjreedy@udel.edu> - 2013-10-24 18:36 -0400
      Re: Python Coverage: testing a program Ethan Furman <ethan@stoneleaf.us> - 2013-10-24 15:28 -0700
      Re: Python Coverage: testing a program Ben Finney <ben+python@benfinney.id.au> - 2013-10-25 10:27 +1100
      Re: Python Coverage: testing a program Ben Finney <ben+python@benfinney.id.au> - 2013-10-25 10:30 +1100
      Re: Python Coverage: testing a program Ned Batchelder <ned@nedbatchelder.com> - 2013-10-24 19:53 -0400
      Re: Python Coverage: testing a program Terry Reedy <tjreedy@udel.edu> - 2013-10-24 19:55 -0400
      Re: Maintaining a backported module Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-10-25 08:49 +0100
  Re: Maintaining a backported module Christian Heimes <christian@python.org> - 2013-10-24 12:47 +0200
  Re: Maintaining a backported module Ethan Furman <ethan@stoneleaf.us> - 2013-10-24 12:42 -0700

csiph-web