[Request] [+ ] D9558: run-tests: configure the environment to expand `~` properly with Windows py38+

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Thu Dec 10 04:29:12 UTC 2020


mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This was causing tests to point to the actual home path on the system, not the
  test defined one.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9558

AFFECTED FILES
  tests/run-tests.py
  tests/test-template-map.t

CHANGE DETAILS

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 @@
   > EOF
 
   $ HOME=`pwd`/home; export HOME
+  $ USERPROFILE=`pwd`/home; export USERPROFILE
 
   $ cat > latesttag/.hg/hgrc <<EOF
   > [ui]
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 @@
         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)



To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20201210/c351596f/attachment.html>


More information about the Mercurial-patches mailing list