Commit f19db07c authored by Stefan Behnel's avatar Stefan Behnel

For srctree tests, include the test directory in the PYTHONPATH of...

For srctree tests, include the test directory in the PYTHONPATH of subprocesses, but not in the own sys.path of the test runner.
parent 93b6cd3d
...@@ -1738,8 +1738,6 @@ class EndToEndTest(unittest.TestCase): ...@@ -1738,8 +1738,6 @@ class EndToEndTest(unittest.TestCase):
_, self.commands = unpack_source_tree(self.treefile, self.workdir, self.cython_root) _, self.commands = unpack_source_tree(self.treefile, self.workdir, self.cython_root)
self.old_dir = os.getcwd() self.old_dir = os.getcwd()
os.chdir(self.workdir) os.chdir(self.workdir)
if self.workdir not in sys.path:
sys.path.insert(0, self.workdir)
def tearDown(self): def tearDown(self):
if self.cleanup_workdir: if self.cleanup_workdir:
...@@ -1764,7 +1762,7 @@ class EndToEndTest(unittest.TestCase): ...@@ -1764,7 +1762,7 @@ class EndToEndTest(unittest.TestCase):
env = dict(os.environ) env = dict(os.environ)
new_path = self.cython_syspath new_path = self.cython_syspath
if old_path: if old_path:
new_path = new_path + os.pathsep + old_path new_path = new_path + os.pathsep + self.workdir + os.pathsep + old_path
env['PYTHONPATH'] = new_path env['PYTHONPATH'] = new_path
if not env.get("PYTHONIOENCODING"): if not env.get("PYTHONIOENCODING"):
env["PYTHONIOENCODING"] = sys.stdout.encoding or sys.getdefaultencoding() env["PYTHONIOENCODING"] = sys.stdout.encoding or sys.getdefaultencoding()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment