test_start_kernel.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:dfkernel 作者: dataflownb 项目源码 文件源码
def test_ipython_start_kernel_no_userns():
    # Issue #4188 - user_ns should be passed to shell as None, not {}
    cmd = ('from IPython import start_kernel\n'
           'start_kernel()')

    with setup_kernel(cmd) as client:
        # user_module should not be an instance of DummyMod
        msg_id = client.execute("usermod = get_ipython().user_module")
        msg = client.get_shell_msg(block=True, timeout=TIMEOUT)
        content = msg['content']
        nt.assert_equal(content['status'], u'ok')
        msg_id = client.inspect('usermod')
        msg = client.get_shell_msg(block=True, timeout=TIMEOUT)
        content = msg['content']
        assert content['found']
        text = content['data']['text/plain']
        nt.assert_not_in(u'DummyMod', text)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号