test_orm.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def test__crashes_on_enter_if_hooks_exist(self):
        hook = Deferred()
        post_commit_hooks.add(hook)
        with ExpectedException(TransactionManagementError):
            with post_commit_hooks:
                pass
        # The hook has been cancelled, but CancelledError is suppressed in
        # hooks, so we don't see it here.
        self.assertThat(hook, IsFiredDeferred())
        # The hook list is cleared so that the exception is raised only once.
        self.assertThat(post_commit_hooks.hooks, HasLength(0))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号