# HG changeset patch # User Pierre-Yves David # Date 2020-03-10 15:47:02 # Node ID fb7da4759a1895b7bfa7099c57139b9c76c6914f # Parent 9803b374389a408dabdd4e3810ed7217ac0186a1 run-tests: fix conditional when tests are run outside of `tests` The logic to find `hghave` was using `__file__` but… non absolute path in `__file__` gets wrong as soon as we change directory (thanks python… you are being helpful). The rest of the `run-tests.py` code already deal with this fine. We simply reuse the `RUNTESTDIR` variable to fix it. diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1626,7 +1626,7 @@ class TTest(Test): return self._have.get(allreqs) # TODO do something smarter when all other uses of hghave are gone. - runtestdir = os.path.abspath(os.path.dirname(_bytespath(__file__))) + runtestdir = osenvironb[b'RUNTESTDIR'] tdir = runtestdir.replace(b'\\', b'/') proc = Popen4( b'%s -c "%s/hghave %s"' % (self._shell, tdir, allreqs),