Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'subject:Python': 0.06; '"if': 0.09; '__name__': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'tismer': 0.09; 'python': 0.11; '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; 'language': 0.16; 'wrote:': 0.18; 'bit': 0.19; '>>>': 0.22; 'programming': 0.22; 'header:User-Agent:1': 0.23; 'url:moin': 0.24; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'url:code': 0.29; 'url:wiki': 0.31; 'exclude': 0.31; 'writes:': 0.31; 'run': 0.32; 'url:python': 0.33; 'but': 0.35; 'coverage': 0.36; 'useful': 0.36; 'url:org': 0.36; 'christian': 0.38; '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; 'tell': 0.60; 'world.': 0.61; 'great': 0.65; 'here': 0.66; '100%': 0.77; 'batchelder': 0.84; 'received:2': 0.84; 'request:': 0.91; 'kit': 0.97 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Python Coverage: testing a program Date: Thu, 24 Oct 2013 22:55:07 +0100 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> <7weh7acrv8.fsf_-_@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-201-160.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 In-Reply-To: <7weh7acrv8.fsf_-_@benfinney.id.au> 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1382651725 news.xs4all.nl 15960 [2001:888:2000:d::a6]:41711 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57475 On 24/10/2013 21:54, Ben Finney wrote: > 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. > An alternative to Ned's great bit of kit is figleaf. This, Ned's and many other useful tools are listed here https://wiki.python.org/moin/PythonTestingToolsTaxonomy -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence