tests/sitecustomize.py
author Siddharth Agarwal <sid0@fb.com>
Mon, 08 May 2017 20:01:06 -0700
changeset 32299 076f1ff43f0f
parent 30486 d2c40510104e
child 43076 2372284d9457
permissions -rw-r--r--
clone: warn when streaming was requested but couldn't be performed This helps both users and the people who support them figure out why a stream clone couldn't be performed. In an upcoming patch we're going to add a way for servers to hard abort on a full getbundle. In those cases servers might expect clients to perform a stream clone, so it's important to communicate why one couldn't be done.

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