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()
评论列表
文章目录