Retain PYTHONPATH if already in env

This commit is contained in:
Joe Rickerby
2019-04-23 22:17:03 +01:00
parent e87032c830
commit f29697d623
+5 -3
View File
@@ -9,9 +9,11 @@ test_utils_dir = os.path.join(project_root, 'test', 'shared')
def single_run(test_project):
# set up an environment that gives access to the test utils
env = os.environ.copy()
env.update({
'PYTHONPATH': test_utils_dir,
})
if 'PYTHONPATH' in env:
env['PYTHONPATH'] += os.pathsep + test_utils_dir
else:
env['PYTHONPATH'] = test_utils_dir
# run the test
subprocess.check_call(