tests: avoid test environment affecting setup.py stable
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Wed, 30 Aug 2023 11:31:05 +0100
branchstable
changeset 50931 a4ec7a92d2c5
parent 50930 5dc7e1907e48
child 50932 afb3cccc90f7
tests: avoid test environment affecting setup.py In particular [RHG_FALLBACK_EXECUTABLE] is being set prematurely, before rhg is built, but probably the rest of the env changes don't help, either.
tests/run-tests.py
--- a/tests/run-tests.py	Mon Sep 04 13:33:32 2023 +0100
+++ b/tests/run-tests.py	Wed Aug 30 11:31:05 2023 +0100
@@ -165,6 +165,7 @@
     return p.decode('utf-8')
 
 
+original_env = os.environ.copy()
 osenvironb = getattr(os, 'environb', None)
 if osenvironb is None:
     # Windows lacks os.environb, for instance.  A proxy over the real thing
@@ -3763,7 +3764,7 @@
         makedirs(self._bindir)
 
         vlog("# Running", cmd.decode("utf-8"))
-        if subprocess.call(_bytes2sys(cmd), shell=True) == 0:
+        if subprocess.call(_bytes2sys(cmd), shell=True, env=original_env) == 0:
             if not self.options.verbose:
                 try:
                     os.remove(installerrs)