tests/sitecustomize.py
author Pulkit Goyal <7895pulkit@gmail.com>
Sun, 11 Mar 2018 16:17:51 +0530
changeset 37089 9938992c5bae
parent 30477 d2c40510104e
child 43076 2372284d9457
permissions -rw-r--r--
remotenames: add functionality to hoist remotebookmarks This patch adds the functionality to hoist remotebookmarks to the top level namespace. The peer of which bookmarks should be hoisted can be set using `remotenames.hoistedpeer` config option. Only bookmarks can be hoisted. If a hoisted name and local bookmark exists of the same name, the local bookmark takes precedence. While I was here, I documented the default values of two other remotenames config options. Differential Revision: https://phab.mercurial-scm.org/D2807
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28946
b12bda49c3e3 py3: use absolute_import in sitecustomize.py
Robert Stanca <robert.stanca7@gmail.com>
parents: 24505
diff changeset
     1
from __future__ import absolute_import
24505
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
     2
import os
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
     3
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
     4
if os.environ.get('COVERAGE_PROCESS_START'):
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
     5
    try:
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
     6
        import coverage
30477
d2c40510104e tests: update sitecustomize to use uuid1() instead of randrange()
Augie Fackler <augie@google.com>
parents: 28946
diff changeset
     7
        import uuid
24505
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
     8
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
     9
        covpath = os.path.join(os.environ['COVERAGE_DIR'],
30477
d2c40510104e tests: update sitecustomize to use uuid1() instead of randrange()
Augie Fackler <augie@google.com>
parents: 28946
diff changeset
    10
                               'cov.%s' % uuid.uuid1())
24505
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
    11
        cov = coverage.coverage(data_file=covpath, auto_data=True)
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
    12
        cov._warn_no_data = False
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
    13
        cov._warn_unimported_source = False
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
    14
        cov.start()
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
    15
    except ImportError:
031947baf4d0 run-tests: collect aggregate code coverage
Gregory Szorc <gregory.szorc@gmail.com>
parents: 14971
diff changeset
    16
        pass