tests/sitecustomize.py
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 03 Nov 2017 22:22:50 -0400
branchstable
changeset 34980 705d0f2bb677
parent 30477 d2c40510104e
child 43076 2372284d9457
permissions -rw-r--r--
pathutil: add doctests for canonpath() This is a followup to f445b10dc7fb. Since there's no way to ensure that more drive letters than C: exist, this seems like the only way to test it. This is enough to catch the f445b10dc7fb scenario, as well as CWD outside of the repo when the path isn't prefixed with path/to/repo.

from __future__ import absolute_import
import os

if os.environ.get('COVERAGE_PROCESS_START'):
    try:
        import coverage
        import uuid

        covpath = os.path.join(os.environ['COVERAGE_DIR'],
                               'cov.%s' % uuid.uuid1())
        cov = coverage.coverage(data_file=covpath, auto_data=True)
        cov._warn_no_data = False
        cov._warn_unimported_source = False
        cov.start()
    except ImportError:
        pass