From ca13ee4557eb22ba0ec54e5d8430dd5975a072af Mon Sep 17 00:00:00 2001 From: Kevin Bates Date: Sat, 12 Sep 2020 09:06:26 -0700 Subject: [PATCH] Remove extra_env and corresponding test --- jupyter_client/manager.py | 4 +--- jupyter_client/tests/test_kernelmanager.py | 28 ---------------------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/jupyter_client/manager.py b/jupyter_client/manager.py index b43b38f13..9bcd08772 100644 --- a/jupyter_client/manager.py +++ b/jupyter_client/manager.py @@ -268,10 +268,8 @@ def pre_start_kernel(self, **kw): # If kernel_cmd has been set manually, don't refer to a kernel spec. # Environment variables from kernel spec are added to os.environ. env.update(self._get_env_substitutions(self.kernel_spec.env, env)) - elif self.extra_env: - env.update(self._get_env_substitutions(self.extra_env, env)) - kw['env'] = env + kw['env'] = env return kernel_cmd, kw def _get_env_substitutions(self, templated_env, substitution_values): diff --git a/jupyter_client/tests/test_kernelmanager.py b/jupyter_client/tests/test_kernelmanager.py index 69a728db7..af7549edf 100644 --- a/jupyter_client/tests/test_kernelmanager.py +++ b/jupyter_client/tests/test_kernelmanager.py @@ -75,27 +75,6 @@ def start_kernel(): assert km.context.closed -@pytest.fixture -def start_kernel_w_env(): - kernel_cmd = [sys.executable, - '-m', 'jupyter_client.tests.signalkernel', - '-f', '{connection_file}'] - extra_env = {'TEST_VARS': '${TEST_VARS}:test_var_2'} - - km = KernelManager(kernel_name='signaltest') - km.kernel_cmd = kernel_cmd - km.extra_env = extra_env - km.start_kernel() - kc = km.client() - kc.start_channels() - - kc.wait_for_ready(timeout=60) - - yield km, kc - kc.stop_channels() - km.shutdown_kernel() - - @pytest.fixture def km(config): km = KernelManager(config=config) @@ -210,13 +189,6 @@ def test_templated_kspec_env(self, install_kernel, start_kernel): assert km.context.closed is False self._env_test_body(kc) - def test_templated_extra_env(self, install_kernel, start_kernel_w_env): - km, kc = start_kernel_w_env - assert km.is_alive() - assert kc.is_alive() - assert km.context.closed is False - self._env_test_body(kc) - def test_cleanup_context(self, km): assert km.context is not None km.cleanup_resources(restart=False)