def tearDown(self): '''Tears down the fixture. Do not override, use the hooks instead. ''' if not int(os.environ.get('erp5_save_data_fs', 0)): # Drop remaining activities if some of them failed. # However, we should not do more activity cleaning, because properly # written unit tests should not leave unprocessed activity messages. # And the user may want to analyse the result of a failed unit test, # so we do nothing in persistent mode (--save). try: portal_activities = self.portal.portal_activities message_list = portal_activities.getMessageList() except StandardError: # AttributeError, TransactionFailedError ... pass else: for m in message_list: if m.processing_node < -1: self.abort() count = portal_activities.countMessage() portal_activities.manageClearActivities() self.commit() ZopeTestCase._print(' (dropped %d left-over activity messages) ' % count) break PortalTestCase.tearDown(self)
def tearDown(self): # avoid any premature tearing down PortalTestCase.tearDown(self)