test_completer.py 文件源码

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

项目:leetcode 作者: thomasyimgit 项目源码 文件源码
def test_magic_completion_shadowing():
    ip = get_ipython()
    c = ip.Completer

    # Before importing matplotlib, %matplotlib magic should be the only option.
    text, matches = c.complete("mat")
    nt.assert_equal(matches, ["%matplotlib"])

    # The newly introduced name should shadow the magic.
    ip.run_cell("matplotlib = 1")
    text, matches = c.complete("mat")
    nt.assert_equal(matches, ["matplotlib"])

    # After removing matplotlib from namespace, the magic should again be
    # the only option.
    del ip.user_ns["matplotlib"]
    text, matches = c.complete("mat")
    nt.assert_equal(matches, ["%matplotlib"])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号