changeset 20513:dcd3bebf4786

run-tests: fix heredoctest for out-of-tree extensions heredoctest.py directory must be in python path to use heredoctest (>>>) in out-of-tree extension tests like: $ cd ext/tests $ python /some/hg/install/tests/run-tests.py test-ext.t
author Patrick Mezard <patrick@mezard.eu>
date Sat, 15 Feb 2014 15:28:32 +0100
parents 659b8d8ddf19
children 410c80539c5c
files tests/run-tests.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Tue Feb 04 15:31:57 2014 -0800
+++ b/tests/run-tests.py	Sat Feb 15 15:28:32 2014 +0100
@@ -1264,8 +1264,9 @@
 
     # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
     # can run .../tests/run-tests.py test-foo where test-foo
-    # adds an extension to HGRC
-    pypath = [PYTHONDIR, TESTDIR]
+    # adds an extension to HGRC. Also include run-test.py directory to import
+    # modules like heredoctest.
+    pypath = [PYTHONDIR, TESTDIR, os.path.abspath(os.path.dirname(__file__))]
     # 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