コード例 #1
0
ファイル: case.py プロジェクト: thraxil/gtreed
 def tearDown(self):
     """Run any teardown method declared in the test class to which
     this method belongs
     """
     if self.testInstance is not None:
         names = ('teardown', 'tearDown')
         try_run(self.testInstance, names)
コード例 #2
0
ファイル: case.py プロジェクト: AlexArgus/affiliates-lib
 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)
コード例 #3
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)
コード例 #4
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)
コード例 #5
0
ファイル: case.py プロジェクト: AlexArgus/affiliates-lib
 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)
コード例 #6
0
 def teardownContext(self, context):
     log.debug("%s teardown context %s", 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)
     self.config.plugins.stopContext(context)
コード例 #7
0
ファイル: suite.py プロジェクト: Byron/bdep-oss
 def teardownContext(self, context):
     log.debug("%s teardown context %s", 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)
     self.config.plugins.stopContext(context)
コード例 #8
0
ファイル: suite.py プロジェクト: scbarber/horriblepoems
 def teardownContext(self, context):
     log.debug("%s teardown context %s", self, context)
     if self.factory:
         self.factory.was_torndown[context] = self
     if isclass(context):
         names = ('teardown_class', 'teardown_all', 'teardownClass',
                  'teardownAll', 'tearDownClass', 'tearDownAll')
     else:
         names = ('teardown_module', 'teardownModule', 'tearDownModule',
                  'teardown')
         if hasattr(context, '__path__'):
             names = ('teardown_package', 'teardownPackage',
                      'tearDownPackage') + names
     try_run(context, names)
     self.config.plugins.stopContext(context)
コード例 #9
0
 def teardownContext(self, context):
     log.debug("%s teardown context %s", self, context)
     if self.factory:
         self.factory.was_torndown[context] = self
     if isclass(context):
         names = ('teardown_class', 'teardown_all', 'teardownClass',
                  'teardownAll', 'tearDownClass', 'tearDownAll')
     else:
         names = ('teardown_module', 'teardownModule', 'tearDownModule',
                  'teardown')
         if hasattr(context, '__path__'):
             names = ('teardown_package', 'teardownPackage',
                      'tearDownPackage') + names
     try_run(context, names)
     self.config.plugins.stopContext(context)
コード例 #10
0
ファイル: suite.py プロジェクト: Byron/bdep-oss
 def setupContext(self, context):
     self.config.plugins.startContext(context)
     log.debug("%s setup context %s", self, context)
     if self.factory:
         if context in self.factory.was_setup:
             return
         # note that I ran the setup for this context, so that I'll run
         # the teardown in my teardown
         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)
コード例 #11
0
 def setupContext(self, context):
     self.config.plugins.startContext(context)
     log.debug("%s setup context %s", self, context)
     if self.factory:
         if context in self.factory.was_setup:
             return
         # note that I ran the setup for this context, so that I'll run
         # the teardown in my teardown
         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)
コード例 #12
0
ファイル: suite.py プロジェクト: scbarber/horriblepoems
 def setupContext(self, context):
     self.config.plugins.startContext(context)
     log.debug("%s setup context %s", self, context)
     if self.factory:
         # note that I ran the setup for this context, so that I'll run
         # the teardown in my teardown
         self.factory.was_setup[context] = self
     if isclass(context):
         names = ('setup_class', 'setup_all', 'setupClass', 'setupAll',
                  'setUpClass', 'setUpAll')
     else:
         names = ('setup_module', 'setupModule', 'setUpModule', 'setup')
         if hasattr(context, '__path__'):
             names = ('setup_package', 'setupPackage',
                      'setUpPackage') + names
     try_run(context, names)
コード例 #13
0
 def setupContext(self, context):
     self.config.plugins.startContext(context)
     log.debug("%s setup context %s", self, context)
     if self.factory:
         # note that I ran the setup for this context, so that I'll run
         # the teardown in my teardown
         self.factory.was_setup[context] = self
     if isclass(context):
         names = ('setup_class', 'setup_all', 'setupClass', 'setupAll',
                  'setUpClass', 'setUpAll')
     else:
         names = ('setup_module', 'setupModule', 'setUpModule', 'setup')
         if hasattr(context, '__path__'):
             names = ('setup_package', 'setupPackage',
                      'setUpPackage') + names
     try_run(context, names)
コード例 #14
0
ファイル: suite.py プロジェクト: thraxil/gtreed
    def tearDown(self):
        """Run any package or module teardown function found. For packages,
        teardown functions may be named 'teardownPackage',
        'teardown_package' or 'teardown'. For modules, teardown functions
        may be named 'teardownModule', 'teardown_module' or
        'teardown'. The teardown function may optionally accept a single
        argument; in that case, the test package or module will be passed
        to the teardown function.

        The teardown function will be run only if any package or module
        setup function completed successfully.
        """
        if hasattr(self.module, '__path__'):
            names = ['teardownPackage', 'teardown_package']
        else:
            names = ['teardownModule', 'teardown_module']
        names += ['tearDown', 'teardown']        
        try_run(self.module, names)
コード例 #15
0
ファイル: suite.py プロジェクト: thraxil/gtreed
 def setUp(self):
     """Run any package or module setup function found. For packages, setup
     functions may be named 'setupPackage', 'setup_package', 'setUp',
     or 'setup'. For modules, setup functions may be named
     'setupModule', 'setup_module', 'setUp', or 'setup'. The setup
     function may optionally accept a single argument; in that case,
     the test package or module will be passed to the setup function.
     """
     log.debug('TestModule.setUp')
     if self.module is None:
         self.module = _import(self.moduleName, [self.path], self.conf)
         log.debug('Imported %s from %s on %s', self.module,
                   self.moduleName, self.path)
     if hasattr(self.module, '__path__'):
         names = ['setupPackage', 'setUpPackage', 'setup_package']
     else:
         names = ['setupModule', 'setUpModule', 'setup_module']
     names += ['setUp', 'setup']
     try_run(self.module, names)
コード例 #16
0
ファイル: suite.py プロジェクト: jonozzz/nose
 def teardownContext(self, context, result):
     log.debug("%s teardown context %s", 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:
         try_run(context, names)
     except KeyboardInterrupt:
         raise
     except:
         self.error_context = 'teardown'
         result.addError(self, self._exc_info())
     self.config.plugins.stopContext(context)
コード例 #17
0
 def tearDown(self):
     try_run(self.inst, ('teardown', 'tearDown'))
コード例 #18
0
 def setUp(self):
     try_run(self.inst, ('setup', 'setUp'))
コード例 #19
0
ファイル: case.py プロジェクト: thraxil/gtreed
 def setUp(self):
     """Run any setup method declared in the test class to which this
     method belongs
     """
     names = ('setup', 'setUp')
     try_run(self.testInstance, names)
コード例 #20
0
ファイル: case.py プロジェクト: AlexArgus/affiliates-lib
 def setUp(self):
     try_run(self.inst, ('setup', 'setUp'))
コード例 #21
0
ファイル: case.py プロジェクト: AlexArgus/affiliates-lib
 def tearDown(self):
     try_run(self.inst, ('teardown', 'tearDown'))