unit_tests.py 文件源码

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

项目:protlib 作者: EliAndrewC 项目源码 文件源码
def delete_logs():
    if hasattr(atexit, "_clear"):
        atexit._clear()
    elif hasattr(atexit, "_exithandlers"):
        atexit._exithandlers[:] = []    # stop the logging module's exit handler

    for suffix in Logger.LEVELS:
        filename = "unit_tests.{0}_log".format(suffix)
        if os.path.exists(filename):
            handlers = logging.getLogger("unit_tests." + suffix).handlers
            if handlers and handlers[0].stream:
                handlers[0].stream.close()
            os.remove(filename)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号