Mercurial > hg
changeset 44471:fb7da4759a18 stable
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.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 10 Mar 2020 16:47:02 +0100 |
parents | 9803b374389a |
children | b7760c2d33de |
files | tests/run-tests.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Mon Mar 09 01:11:59 2020 +0100 +++ b/tests/run-tests.py Tue Mar 10 16:47:02 2020 +0100 @@ -1626,7 +1626,7 @@ 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),