Mercurial > hg
changeset 6349:6aaf5b1d8f15
coverage: deal with symlinked input paths (MacOSX issue)
/tmp is symlinked in MacOSX therefore test scripts as well as python modules
are installed in a symlinked location. coverage.py uses abspath() to normalize
its inputs which fails if these are referencing real paths. Use realpath()
instead.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 22 Mar 2008 19:01:09 +0100 |
parents | f8feaa665319 |
children | 6aa4a3fa4e60 34e4f4ef4936 |
files | tests/coverage.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/coverage.py Sat Mar 22 18:01:46 2008 +0100 +++ b/tests/coverage.py Sat Mar 22 19:01:09 2008 +0100 @@ -412,6 +412,9 @@ else: omit = [] + omit = [os.path.normcase(os.path.abspath(os.path.realpath(p))) + for p in omit] + if settings.get('report'): self.report(args, show_missing, ignore_errors, omit_prefixes=omit) if settings.get('annotate'): @@ -537,7 +540,7 @@ if os.path.exists(g): f = g break - cf = os.path.normcase(os.path.abspath(f)) + cf = os.path.normcase(os.path.abspath(os.path.realpath(f))) self.canonical_filename_cache[filename] = cf return self.canonical_filename_cache[filename]