helpconfig.py 文件源码

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

项目:godot-python 作者: touilleMan 项目源码 文件源码
def showhelp(config):
    reporter = config.pluginmanager.get_plugin('terminalreporter')
    tw = reporter._tw
    tw.write(config._parser.optparser.format_help())
    tw.line()
    tw.line()
    tw.line("[pytest] ini-options in the first "
            "pytest.ini|tox.ini|setup.cfg file found:")
    tw.line()

    for name in config._parser._ininames:
        help, type, default = config._parser._inidict[name]
        if type is None:
            type = "string"
        spec = "%s (%s)" % (name, type)
        line = "  %-24s %s" %(spec, help)
        tw.line(line[:tw.fullwidth])

    tw.line()
    tw.line("environment variables:")
    vars = [
        ("PYTEST_ADDOPTS", "extra command line options"),
        ("PYTEST_PLUGINS", "comma-separated plugins to load during startup"),
        ("PYTEST_DEBUG", "set to enable debug tracing of pytest's internals")
    ]
    for name, help in vars:
        tw.line("  %-24s %s" % (name, help))
    tw.line()
    tw.line()

    tw.line("to see available markers type: pytest --markers")
    tw.line("to see available fixtures type: pytest --fixtures")
    tw.line("(shown according to specified file_or_dir or current dir "
            "if not specified)")

    for warningreport in reporter.stats.get('warnings', []):
        tw.line("warning : " + warningreport.message, red=True)
    return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号