tests/sitecustomize.py
author Raphaël Gomès <rgomes@octobus.net>
Tue, 12 Apr 2022 17:29:21 +0200
changeset 49193 c6c1caf28349
parent 48966 6000f5b25c9b
permissions -rw-r--r--
rust-dirstate-entry: add `modified` method This will also be used in other places later in the series. Differential Revision: https://phab.mercurial-scm.org/D12536

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