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 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 initialisation). 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/...