tests/sitecustomize.py
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 21 Jun 2017 10:46:18 +0200
changeset 32996 41b081ac2145
parent 30486 d2c40510104e
child 43076 2372284d9457
permissions -rw-r--r--
profiling: cope with configwith default value handling changes Changeset 6ff6eb33f353 change 'configwith' behavior so that the default value is run through the conversion function. In parallel a new user of 'configwith' got introduced unaware of this coming behavior change. This broke profiling. We resolve the situation by having the new conversion function cope with a default value already using the right type.

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