From patchwork Sat Feb 15 16:06:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: run-tests: fix heredoctest for out-of-tree extensions From: Patrick Mezard X-Patchwork-Id: 3674 Message-Id: To: mercurial-devel@selenic.com Date: Sat, 15 Feb 2014 17:06:44 +0100 # HG changeset patch # User Patrick Mezard # Date 1392474512 -3600 # Sat Feb 15 15:28:32 2014 +0100 # Node ID e0917bcc3140e482ce2ed64519eb93182305ca42 # Parent e5a2177d97f04e851cede67712ec6ecbc72818d7 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 diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1255,8 +1255,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