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.
--- 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)