本文整理匯總了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))