run-tests: don't replace PYTHONPATH, just augment it.
authorGreg Ward <greg-hg@gerg.ca>
Mon, 01 Jun 2009 09:18:35 -0400
changeset 8687 78ab2a12b4d9
parent 8686 ad1907abf897
child 8688 31e613a89750
run-tests: don't replace PYTHONPATH, just augment it. (Needed at least for Subversion bindings on OS X, which are in /opt/subversion. Useful for other external libraries installed in non-standard places too.)
tests/run-tests.py
--- a/tests/run-tests.py	Mon Jun 01 01:24:01 2009 +0200
+++ b/tests/run-tests.py	Mon Jun 01 09:18:35 2009 -0400
@@ -755,9 +755,12 @@
         path = [BINDIR] + os.environ["PATH"].split(os.pathsep)
         os.environ["PATH"] = os.pathsep.join(path)
 
-        # Deliberately override existing PYTHONPATH: do not want success
-        # to depend on what happens to be in caller's environment.
-        os.environ["PYTHONPATH"] = PYTHONDIR
+        # We have to augment PYTHONPATH, rather than simply replacing
+        # it, in case external libraries are only available via current
+        # PYTHONPATH.  (In particular, the Subversion bindings on OS X
+        # are in /opt/subversion.)
+        os.environ["PYTHONPATH"] = (PYTHONDIR + os.pathsep +
+                                    os.environ.get("PYTHONPATH", ""))
 
     COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")