changeset 8687:78ab2a12b4d9

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.)
author Greg Ward <greg-hg@gerg.ca>
date Mon, 01 Jun 2009 09:18:35 -0400
parents ad1907abf897
children 31e613a89750
files tests/run-tests.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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")