From 60fac9d3d41051acc9b3d613e37f056a75b78585 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 19:30:46 +0100 Subject: [PATCH] [debug] pass the env parameter --- test/test_compilation/test_compilation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index b315cce7..6beb8bc6 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -101,6 +101,8 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): if steps: command.extend(['--steps', steps]) + current_env = os.environ.copy() + current_env['PYTHONPATH'] = ':'.join(sys.path) print("#######") print(command) print("#######") @@ -131,7 +133,8 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): emptymod = subprocess.check_output( [sys.executable, "-m", 'patacrep.songbook', 'cwd.sb'], stderr=subprocess.STDOUT, - cwd=os.path.dirname(songbook) + cwd=os.path.dirname(songbook), + env=current_env ) print(emptymod) except subprocess.CalledProcessError as error: @@ -142,7 +145,8 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): importcwd = subprocess.check_output( [sys.executable, "-c", 'import patacrep.songbook as sb;print(sb)'], stderr=subprocess.STDOUT, - cwd=os.path.dirname(songbook) + cwd=os.path.dirname(songbook), + env=current_env ) print(importcwd) except subprocess.CalledProcessError as error: