hgext/__init__.py
author Sangeet Kumar Mishra <mail2sangeetmishra@gmail.com>
Sat, 03 Nov 2018 23:24:15 +0530
changeset 40487 78e5b9d815fa
parent 28450 155e3308289c
child 43076 2372284d9457
permissions -rw-r--r--
test: fix self._testdir to use the right mercurial library during testing Currently if you run tests from some other directory other than the `../tests/`, you will get a warning stating ``` warning: Testing with unexpected mercurial lib: mercurial (expected /tmp/hgtests.xxxxxx/install/lib/python/mercurial) ``` This is because the current directory being added to the 'PATH', if the `self._testdir != runtestdir`, owing to this line ``` if self._testdir != runtestdir: path = [self._testdir] + path ``` Also say you ran the tests from the hg base directory, because directory is being added in the PATH (see the above snippet, at that stage the `self._testdir` has the value as `cwd`, owing to a faulty initialization). And since the current directory already has the 'hg', that is used in place of the hg that is installed for the testing purposes in `/tmp/hgtests.xxxxxx/...`. Differential Revision: https://phab.mercurial-scm.org/D5199

from __future__ import absolute_import
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)