##// END OF EJS Templates
Merge pull request #4016 from takluyver/IPython-start-funcs...
Merge pull request #4016 from takluyver/IPython-start-funcs Fix IPython.start_* functions start_kernel() didn't work at all (#4005), and I found while investigating that passing user_ns to either start_ipython() or start_kernel() had no effect, because the Application wasn't passing it on to the Shell. This is a simple fix for the most pressing issues. We should think about any other parameters that we want to be passed through from our top level API, e.g. possibly user_module. closes #4005

File last commit:

r12182:6aa5b412
r12189:d3e2f732 merge
Show More
test_start_kernel.py
16 lines | 531 B | text/x-python | PythonLexer
import nose.tools as nt
from .test_embed_kernel import setup, teardown, setup_kernel
TIMEOUT = 15
def test_ipython_start_kernel_userns():
cmd = ('from IPython import start_kernel\n'
'ns = {"tre": 123}\n'
'start_kernel(user_ns=ns)')
with setup_kernel(cmd) as client:
msg_id = client.object_info('tre')
msg = client.get_shell_msg(block=True, timeout=TIMEOUT)
content = msg['content']
assert content['found']
nt.assert_equal(content['string_form'], u'123')