diff tests/run-tests.py @ 51963:5e2f0fec0a47

branching: merge stable into default
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 08 Oct 2024 21:46:22 +0200
parents f4c038081561 16574ca8b155
children
line wrap: on
line diff
--- a/tests/run-tests.py	Fri Oct 04 13:26:29 2024 -0400
+++ b/tests/run-tests.py	Tue Oct 08 21:46:22 2024 +0200
@@ -3372,6 +3372,10 @@
             pypath.append(oldpypath)
         osenvironb[IMPL_PATH] = sepb.join(pypath)
 
+        os.environ["HGTEST_BASE_HGMODULEPOLICY"] = os.environ.get(
+            "HGMODULEPOLICY", ""
+        )
+
         if self.options.pure:
             os.environ["HGTEST_RUN_TESTS_PURE"] = "--pure"
             os.environ["HGMODULEPOLICY"] = "py"
@@ -3781,15 +3785,18 @@
         vlog("# Performing temporary installation of HG")
         installerrs = os.path.join(self._hgtmp, b"install.err")
         compiler = ''
+        install_env = original_env.copy()
         if self.options.compiler:
             compiler = '--compiler ' + self.options.compiler
         setup_opts = b""
         if self.options.pure:
             setup_opts = b"--pure"
+            install_env.pop('HGWITHRUSTEXT', None)
         elif self.options.rust:
             setup_opts = b"--rust"
         elif self.options.no_rust:
             setup_opts = b"--no-rust"
+            install_env.pop('HGWITHRUSTEXT', None)
 
         # Run installer in hg root
         compiler = _sys2bytes(compiler)
@@ -3835,7 +3842,7 @@
         makedirs(self._bindir)
 
         vlog("# Running", cmd.decode("utf-8"))
-        if subprocess.call(_bytes2sys(cmd), shell=True, env=original_env) == 0:
+        if subprocess.call(_bytes2sys(cmd), shell=True, env=install_env) == 0:
             if not self.options.verbose:
                 try:
                     os.remove(installerrs)