comparison tests/run-tests.py @ 50931:a4ec7a92d2c5 stable

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.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Wed, 30 Aug 2023 11:31:05 +0100
parents 787e7caf887a
children afb3cccc90f7
comparison
equal deleted inserted replaced
50930:5dc7e1907e48 50931:a4ec7a92d2c5
163 if p is None: 163 if p is None:
164 return p 164 return p
165 return p.decode('utf-8') 165 return p.decode('utf-8')
166 166
167 167
168 original_env = os.environ.copy()
168 osenvironb = getattr(os, 'environb', None) 169 osenvironb = getattr(os, 'environb', None)
169 if osenvironb is None: 170 if osenvironb is None:
170 # Windows lacks os.environb, for instance. A proxy over the real thing 171 # Windows lacks os.environb, for instance. A proxy over the real thing
171 # instead of a copy allows the environment to be updated via bytes on 172 # instead of a copy allows the environment to be updated via bytes on
172 # all platforms. 173 # all platforms.
3761 3762
3762 makedirs(self._pythondir) 3763 makedirs(self._pythondir)
3763 makedirs(self._bindir) 3764 makedirs(self._bindir)
3764 3765
3765 vlog("# Running", cmd.decode("utf-8")) 3766 vlog("# Running", cmd.decode("utf-8"))
3766 if subprocess.call(_bytes2sys(cmd), shell=True) == 0: 3767 if subprocess.call(_bytes2sys(cmd), shell=True, env=original_env) == 0:
3767 if not self.options.verbose: 3768 if not self.options.verbose:
3768 try: 3769 try:
3769 os.remove(installerrs) 3770 os.remove(installerrs)
3770 except FileNotFoundError: 3771 except FileNotFoundError:
3771 pass 3772 pass