# HG changeset patch # User Matt Harbison # Date 2020-12-09 20:50:59 # Node ID 08fd76a553c966e78b5785b640d405c154081210 # Parent af3a6900f893acc5858cbb1a49a8872b03dd22a1 run-tests: configure the environment to expand `~` properly with Windows py38+ This was causing tests to point to the actual home path on the system, not the test defined one. Differential Revision: https://phab.mercurial-scm.org/D9558 diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1335,6 +1335,9 @@ class Test(unittest.TestCase): env['TESTTMP'] = _bytes2sys(self._testtmp) env['TESTNAME'] = self.name env['HOME'] = _bytes2sys(self._testtmp) + if os.name == 'nt': + # py3.8+ ignores HOME: https://bugs.python.org/issue36264 + env['USERPROFILE'] = env['HOME'] formated_timeout = _bytes2sys(b"%d" % default_defaults['timeout'][1]) env['HGTEST_TIMEOUT_DEFAULT'] = formated_timeout env['HGTEST_TIMEOUT'] = _bytes2sys(b"%d" % self._timeout) diff --git a/tests/test-template-map.t b/tests/test-template-map.t --- a/tests/test-template-map.t +++ b/tests/test-template-map.t @@ -1972,6 +1972,7 @@ if it is a relative path > EOF $ HOME=`pwd`/home; export HOME + $ USERPROFILE=`pwd`/home; export USERPROFILE $ cat > latesttag/.hg/hgrc < [ui]