base.py 文件源码

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

项目:pyramid_runner 作者: asif-mahmud 项目源码 文件源码
def tearDown(self):
        """Calls `pyramid.testing.tearDown` and `transaction.abort`.

        Prior to calling these methods if any `clean_db` method is
        defined, it will be called. Do database clean ups there.
        """
        try:
            __clean_db = self.__getattribute__('clean_db')
            if callable(__clean_db):
                with transaction.manager:
                    __clean_db()
        except AttributeError:
            pass

        testing.tearDown()
        transaction.abort()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号