[PATCH 1 of 2] tests: fix omit path list

Matt Mackall mpm at selenic.com
Thu Jan 12 14:30:54 CST 2012


On Wed, 2012-01-11 at 17:16 +0100, Markus Zapke-Gründemann wrote:
> # HG changeset patch
> # User Markus Zapke-Gründemann <info at keimlink.de>
> # Date 1326292645 -3600
> # Node ID 1d105733e04aaab0960da0b185aa6f3b02173483
> # Parent  3cf2bb3a9fcce4ca7e985036a7d6388804a46096
> tests: fix omit path list
> 
> All directories need a trailing asterisk. Otherwise the files are not excluded
> from coverage.
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -493,7 +493,7 @@ def outputcoverage(options):
>          return
>  
>      covrun('-c')
> -    omit = ','.join([BINDIR, TESTDIR])
> +    omit = ','.join(map(os.path.join, [BINDIR, TESTDIR], ['*'] * 2))
>      covrun('-i', '-r', '"--omit=%s"' % omit) # report

We generally prefer list comprehensions to map. This would be better as:

omit = [os.path.join(x, '*') for x in [BINDIR, TESTDIR]]
covrun(..., % (','.join(omit)))

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list