test_multierror.py 文件源码

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

项目:trio 作者: python-trio 项目源码 文件源码
def test_logging(caplog):
    exc1 = get_exc(raiser1)
    exc2 = get_exc(raiser2)

    m = MultiError([exc1, exc2])

    message = "test test test"
    try:
        raise m
    except MultiError as exc:
        logging.getLogger().exception(message)
        # Join lines together
        formatted = "".join(
            format_exception(type(exc), exc, exc.__traceback__)
        )
        assert message in caplog.text
        assert formatted in caplog.text
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号