Skip to content

Commit

Permalink
Remove extra_env and corresponding test (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-bates authored Sep 12, 2020
1 parent 793fbec commit 842fa46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
4 changes: 1 addition & 3 deletions jupyter_client/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
28 changes: 0 additions & 28 deletions jupyter_client/tests/test_kernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 842fa46

Please sign in to comment.