def setUp(self): from stoqlib.database.runtime import new_store self.store = new_store() self.fake.set_store(self.store) self.set_store(self.store) self._unhandled_exceptions = [] self._old_hook = sys.excepthook sys.excepthook = self._except_hook test_system_notifier.reset() DomainTest.setUp(self)
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))
def tearDown(self): self.store.close() self.fake.set_store(None) self.clear() sys.excepthook = self._old_hook 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))
def setUp(self): self._unhandled_exceptions = [] self._old_hook = sys.excepthook sys.excepthook = self._except_hook test_system_notifier.reset() DomainTest.setUp(self)