def setUp(self): """Run any setup function attached to the test function """ if self.setUpFunc: self.setUpFunc() else: names = ("setup", "setUp", "setUpFunc") try_run(self.test, names)
def tearDown(self): """Run any teardown function attached to the test function """ if self.tearDownFunc: self.tearDownFunc() else: names = ("teardown", "tearDown", "tearDownFunc") try_run(self.test, names)
def teardownContext(self, context): if self.factory: if context in self.factory.was_torndown: return self.factory.was_torndown[context] = self if isclass(context): names = self.classTeardown else: names = self.moduleTeardown if hasattr(context, '__path__'): names = self.packageTeardown + names try_run(context, names)
def setupContext(self, context): if self.factory: if context in self.factory.was_setup: return self.factory.was_setup[context] = self if isclass(context): names = self.classSetup else: names = self.moduleSetup if hasattr(context, '__path__'): names = self.packageSetup + names try_run(context, names)
def tearDown(self): try_run(self.inst, ("teardown", "tearDown"))
def setUp(self): try_run(self.inst, ("setup", "setUp"))
def tearDown(self): try_run(self.inst, ('teardown', 'tearDown'))
def setUp(self): try_run(self.inst, ('setup', 'setUp'))