##// END OF EJS Templates
Use Instance trait for user_ns instead of Dict....
Use Instance trait for user_ns instead of Dict. Instance(dict) is None by default, unlike Dict().

File last commit:

r12182:6aa5b412
r12476:f9545617
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')