In usecorrectpython, run-tests calls into self._findprogram, https://www.mercurial-scm.org/repo/hg-committed/file/5.4.1/tests/run-tests.py#l3441. On python 3, that returns bytes, while sysexecutable is a string, and that check always fails. Glancing at the callers of _findprogram, that could probably return a proper string?
Do you have a reproducable test case where this gives undesirable behavior? Mercurial prefers to do everything with bytes. However, this is only partially the case in run-tests.py, so changing `_findprogram` to return str is maybe a viable option. Will you send a patch?
I"m using `path/to/hg/tests/run-test.py --with-hg=venv/bin/hg tests/test-*.t` to run tests in another project, inside a virtualenv. The result is that python gets linked, and then the packages in my virtualenv aren't found. It's been a while since I tried to get patches in, but I can give it a shot.
Created https://phab.mercurial-scm.org/D8674
Fixed by https://mercurial-scm.org/repo/hg/rev/383005aa9cdc Axel Hecht <axel@pike.org> run-tests: find python binary on Python 3 (issue6361) Return strings from _findprogram as all callers expect unicode strings. Previously the check in _usecorrectpython agains sysexecutable was always false on Python 3. Differential Revision: https://phab.mercurial-scm.org/D8674 (please test the fix)
Thanks, updated my local clone and reran my tests, and they're all cheers now.
Bug was set to TESTING for 7 days, resolving