Forward coverage envvars needed to cover subprocess

This commit is contained in:
Daniel Graña 2015-08-13 20:52:38 -03:00
parent 43fc2f23b8
commit 27077d2b6c
1 changed files with 8 additions and 0 deletions

View File

@ -13,6 +13,14 @@ os.environ['http_proxy'] = ''
os.environ['https_proxy'] = ''
os.environ['ftp_proxy'] = ''
# Absolutize paths to coverage config and output file because tests that
# spawn subprocesses also changes current working directory.
_sourceroot = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if 'COV_CORE_CONFIG' in os.environ:
os.environ['COVERAGE_FILE'] = os.path.join(_sourceroot, '.coverage')
os.environ['COV_CORE_CONFIG'] = os.path.join(_sourceroot,
os.environ['COV_CORE_CONFIG'])
try:
import unittest.mock as mock
except ImportError: