本文整理汇总了Python中stoqlib.domain.test.domaintest.DomainTest.tearDown方法的典型用法代码示例。如果您正苦于以下问题:Python DomainTest.tearDown方法的具体用法?Python DomainTest.tearDown怎么用?Python DomainTest.tearDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.test.domaintest.DomainTest
的用法示例。
在下文中一共展示了DomainTest.tearDown方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: tearDown
# 需要导入模块: from stoqlib.domain.test.domaintest import DomainTest [as 别名]
# 或者: from stoqlib.domain.test.domaintest.DomainTest import tearDown [as 别名]
def tearDown(self):
store = new_store()
for person in store.find(Person, name=NAME):
store.remove(person)
store.commit()
DomainTest.tearDown(self)
store.close()
示例2: tearDown
# 需要导入模块: from stoqlib.domain.test.domaintest import DomainTest [as 别名]
# 或者: from stoqlib.domain.test.domaintest.DomainTest import tearDown [as 别名]
def tearDown(self):
# Make sure to remove all committed persons from the database
with new_store() as store:
test_names = [u'dummy transaction test', u'dummy', u'doe', u'john']
store.find(Person, Person.name.is_in(test_names)).remove()
DomainTest.tearDown(self)
示例3: tearDown
# 需要导入模块: from stoqlib.domain.test.domaintest import DomainTest [as 别名]
# 或者: from stoqlib.domain.test.domaintest.DomainTest import tearDown [as 别名]
def tearDown(self):
DomainTest.tearDown(self)
try:
os.unlink(self._filename)
except OSError:
pass
if self._pdf_html:
try:
os.unlink(self._pdf_html)
except OSError:
pass
示例4: tearDown
# 需要导入模块: from stoqlib.domain.test.domaintest import DomainTest [as 别名]
# 或者: from stoqlib.domain.test.domaintest.DomainTest import tearDown [as 别名]
def tearDown(self):
sys.excepthook = self._old_hook
DomainTest.tearDown(self)
messages = test_system_notifier.reset()
if messages:
self.fail("Unhandled messages: %r, use @mock.patch()" % (
messages, ))
if self._unhandled_exceptions:
self.fail("Unhandled exceptions: %r" % (
self._unhandled_exceptions))