From 7f1673596fcbc5e987cfeef32c021a5a73b429e2 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 2 Aug 2019 16:49:50 -0600 Subject: [PATCH] Pass the whole parent environment down to the child You never know what is in here that is totally essential to the operation of some random thing. :( --- integration/conftest.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/integration/conftest.py b/integration/conftest.py index 98091c7ce..06ab51655 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -3,7 +3,7 @@ from __future__ import print_function import sys import shutil from time import sleep -from os import mkdir, listdir +from os import mkdir, listdir, environ from os.path import join, exists from tempfile import mkdtemp, mktemp from functools import partial @@ -467,7 +467,8 @@ def chutney(reactor, temp_dir): '/usr/bin/git', 'clone', '--depth=1', 'https://git.torproject.org/chutney.git', chutney_dir, - ) + ), + env=environ, ) pytest_twisted.blockon(proto.done) return chutney_dir @@ -483,6 +484,8 @@ def tor_network(reactor, temp_dir, chutney, request): # ./chutney configure networks/basic # ./chutney start networks/basic + env = environ.copy() + env.update({"PYTHONPATH": join(chutney_dir, "lib")}) proto = _DumpOutputProtocol(None) reactor.spawnProcess( proto, @@ -492,7 +495,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) pytest_twisted.blockon(proto.done) @@ -505,7 +508,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) pytest_twisted.blockon(proto.done) @@ -519,7 +522,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) try: pytest_twisted.blockon(proto.done) @@ -538,7 +541,7 @@ def tor_network(reactor, temp_dir, chutney, request): join(chutney_dir, 'networks', 'basic'), ), path=join(chutney_dir), - env={"PYTHONPATH": join(chutney_dir, "lib")}, + env=env, ) pytest_twisted.blockon(proto.done) request.addfinalizer(cleanup)