Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra_env and corresponding test #581

Merged
merged 1 commit into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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