test_application.py 文件源码

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

项目:yatta_reader 作者: sound88 项目源码 文件源码
def test_cli_priority():
    with TemporaryDirectory() as td:

        class TestApp(BaseIPythonApplication):
            test = Unicode().tag(config=True)

        # Create the config file, so it tries to load it.
        with open(os.path.join(td, 'ipython_config.py'), "w") as f:
            f.write("c.TestApp.test = 'config file'")

        app = TestApp()
        app.initialize(['--profile-dir', td])
        nt.assert_equal(app.test, 'config file')
        app = TestApp()
        app.initialize(['--profile-dir', td, '--TestApp.test=cli'])
        nt.assert_equal(app.test, 'cli')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号