From 463643e2a4df11a2e5b0eac1561b712176adb6b0 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 22 Oct 2010 14:23:38 +0200 Subject: [PATCH] fix end-to-end test setup in Py3 --- runtests.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/runtests.py b/runtests.py index 8d3f74e0..150b5f7d 100644 --- a/runtests.py +++ b/runtests.py @@ -640,6 +640,14 @@ class EndToEndTest(unittest.TestCase): self.treefile = treefile self.workdir = os.path.join(workdir, os.path.splitext(treefile)[0]) self.cleanup_workdir = cleanup_workdir + cython_syspath = self.cython_root + for path in sys.path[::-1]: + if path.startswith(self.cython_root): + # Py3 installation and refnanny build prepend their + # fixed paths to sys.path => prefer that over the + # generic one + cython_syspath = path + os.pathsep + cython_syspath + self.cython_syspath = cython_syspath unittest.TestCase.__init__(self) def shortDescription(self): @@ -664,7 +672,8 @@ class EndToEndTest(unittest.TestCase): .replace("PYTHON", sys.executable)) old_path = os.environ.get('PYTHONPATH') try: - os.environ['PYTHONPATH'] = self.cython_root + os.pathsep + (old_path or '') + os.environ['PYTHONPATH'] = self.cython_syspath + os.pathsep + (old_path or '') + print(os.environ['PYTHONPATH']) self.assertEqual(0, os.system(commands)) finally: if old_path: -- 2.26.2