helpconfig.py 文件源码

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

项目:sslstrip-hsts-openwrt 作者: adde88 项目源码 文件源码
def pytest_cmdline_parse():
    outcome = yield
    config = outcome.get_result()
    if config.option.debug:
        path = os.path.abspath("pytestdebug.log")
        debugfile = open(path, 'w')
        debugfile.write("versions pytest-%s, py-%s, "
                "python-%s\ncwd=%s\nargs=%s\n\n" %(
            pytest.__version__, py.__version__,
            ".".join(map(str, sys.version_info)),
            os.getcwd(), config._origargs))
        config.trace.root.setwriter(debugfile.write)
        undo_tracing = config.pluginmanager.enable_tracing()
        sys.stderr.write("writing pytestdebug information to %s\n" % path)
        def unset_tracing():
            debugfile.close()
            sys.stderr.write("wrote pytestdebug information to %s\n" %
                             debugfile.name)
            config.trace.root.setwriter(None)
            undo_tracing()
        config.add_cleanup(unset_tracing)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号