comparison tests/coverage.py @ 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 a7178d4ed8ee
children 277c91fe8384
comparison
equal deleted inserted replaced
6348:f8feaa665319 6349:6aaf5b1d8f15
410 if omit is not None: 410 if omit is not None:
411 omit = omit.split(',') 411 omit = omit.split(',')
412 else: 412 else:
413 omit = [] 413 omit = []
414 414
415 omit = [os.path.normcase(os.path.abspath(os.path.realpath(p)))
416 for p in omit]
417
415 if settings.get('report'): 418 if settings.get('report'):
416 self.report(args, show_missing, ignore_errors, omit_prefixes=omit) 419 self.report(args, show_missing, ignore_errors, omit_prefixes=omit)
417 if settings.get('annotate'): 420 if settings.get('annotate'):
418 self.annotate(args, directory, ignore_errors, omit_prefixes=omit) 421 self.annotate(args, directory, ignore_errors, omit_prefixes=omit)
419 422
535 for path in [os.curdir] + sys.path: 538 for path in [os.curdir] + sys.path:
536 g = os.path.join(path, f) 539 g = os.path.join(path, f)
537 if os.path.exists(g): 540 if os.path.exists(g):
538 f = g 541 f = g
539 break 542 break
540 cf = os.path.normcase(os.path.abspath(f)) 543 cf = os.path.normcase(os.path.abspath(os.path.realpath(f)))
541 self.canonical_filename_cache[filename] = cf 544 self.canonical_filename_cache[filename] = cf
542 return self.canonical_filename_cache[filename] 545 return self.canonical_filename_cache[filename]
543 546
544 # canonicalize_filenames(). Copy results from "c" to "cexecuted", 547 # canonicalize_filenames(). Copy results from "c" to "cexecuted",
545 # canonicalizing filenames on the way. Clear the "c" map. 548 # canonicalizing filenames on the way. Clear the "c" map.