tests/sitecustomize.py
changeset 30477 d2c40510104e
parent 28946 b12bda49c3e3
child 43076 2372284d9457
equal deleted inserted replaced
30476:8a9681b963a3 30477:d2c40510104e
     2 import os
     2 import os
     3 
     3 
     4 if os.environ.get('COVERAGE_PROCESS_START'):
     4 if os.environ.get('COVERAGE_PROCESS_START'):
     5     try:
     5     try:
     6         import coverage
     6         import coverage
     7         import random
     7         import uuid
     8 
     8 
     9         # uuid is better, but not available in Python 2.4.
       
    10         covpath = os.path.join(os.environ['COVERAGE_DIR'],
     9         covpath = os.path.join(os.environ['COVERAGE_DIR'],
    11                                'cov.%s' % random.randrange(0, 1000000000000))
    10                                'cov.%s' % uuid.uuid1())
    12         cov = coverage.coverage(data_file=covpath, auto_data=True)
    11         cov = coverage.coverage(data_file=covpath, auto_data=True)
    13         cov._warn_no_data = False
    12         cov._warn_no_data = False
    14         cov._warn_unimported_source = False
    13         cov._warn_unimported_source = False
    15         cov.start()
    14         cov.start()
    16     except ImportError:
    15     except ImportError: