Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; '"if': 0.09; '__name__': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:module': 0.09; 'clauses': 0.16; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'statements,': 0.16; 'subject:program': 0.16; 'ignore': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'url:code': 0.29; 'exclude': 0.31; 'writes:': 0.31; 'run': 0.32; 'subject: (': 0.35; 'coverage': 0.36; 'ben': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'reported': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'expression': 0.60; 'tell': 0.60; 'believe': 0.68; '100%': 0.77; 'batchelder': 0.84; 'request:': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Python Coverage: testing a program (was: Maintaining a backported module) Date: Fri, 25 Oct 2013 07:54:03 +1100 References: <5268a818$0$30000$c3e8da3$5496439d@news.astraweb.com> <7wtxg7cfww.fsf@benfinney.id.au> <526908b2$0$29981$c3e8da3$5496439d@news.astraweb.com> <52695CFB.9010309@nedbatchelder.com> <526984F3.3040905@udel.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: rasputin.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-gpg.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:0jzJaiGcK+BB+zKYAEp7e2h02eY= 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: 1382648059 news.xs4all.nl 15884 [2001:888:2000:d::a6]:50017 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57470 Terry Reedy writes: > On 10/24/2013 1:46 PM, Ned Batchelder wrote: > > It's been fun dropping the contortions for coverage.py 4.x, though! > > One request: ignore "if __name__ == '__main__':" clauses at the end of > files, which cannot be run under coverage.py, so 100% coverage is > reported as 100% instead of 9x%. You can do this already with current Coverage: tell Coverage to exclude specific statements, and it won't count them for coverage calculations. -- \ “If we don't believe in freedom of expression for people we | `\ despise, we don't believe in it at all.” —Noam Chomsky, | _o__) 1992-11-25 | Ben Finney