示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 def tearDown(self):
     try_run(self.inst, ("teardown", "tearDown"))
示例#6
0
 def setUp(self):
     try_run(self.inst, ("setup", "setUp"))
示例#7
0
 def tearDown(self):
     try_run(self.inst, ('teardown', 'tearDown'))
示例#8
0
 def setUp(self):
     try_run(self.inst, ('setup', 'setUp'))
示例#9
0
 def setUp(self):
     try_run(self.inst, ('setup', 'setUp'))