当前位置: 首页>>代码示例>>Python>>正文


Python TestCase.run方法代码示例

本文整理汇总了Python中unittest.TestCase.run方法的典型用法代码示例。如果您正苦于以下问题:Python TestCase.run方法的具体用法?Python TestCase.run怎么用?Python TestCase.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在unittest.TestCase的用法示例。


在下文中一共展示了TestCase.run方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
    def run(self, result=None):
        log.test("#" * 50)	#Venkat
	python_version=pexpect.run('python -V')	#Venkat
        log.test("Python Version: %s" % python_version.strip())#Venkat
        log.test("#" * 50)	#Venkat
        log.test("#" * 50)
        log.test(self._testMethodName)
        log.test("#" * 50)
        TestCase.run(self, result)
开发者ID:muttu2244,项目名称:MyPython,代码行数:11,代码来源:StokeTest.py

示例2: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
 def run(self, result=None):
     BaseTestCase.run(self, result)
     if result is not None:
         errors = result.errors
         skip_error = (
             'in skipTest\n    raise SkipException(msg)')
         result.errors = []
         for error in errors:
             if skip_error in error[1]:
                 print ('Skipped')
             else:
                 result.errors.append(error)
     return result
开发者ID:enthought,项目名称:pywin32-ctypes,代码行数:15,代码来源:compat.py

示例3: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
 def run(self, result):
     """
     Call the parent run() for each backend instance.
     Skip the test if we have no backends.
     """
     try:
         if not len(self.backends):
             result.startTest(self)
             result.stopTest(self)
             raise SkipTest('No backends configured for this module.')
         TestCase.run(self, result)
     finally:
         self.weboob.deinit()
开发者ID:Boussadia,项目名称:weboob,代码行数:15,代码来源:test.py

示例4: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
 def run(self, result):
     """
     Call the parent run() for each backend instance.
     Skip the test if we have no backends.
     """
     # This is a hack to fix an issue with nosetests running
     # with many tests. The default is 1000.
     sys.setrecursionlimit(10000)
     try:
         if not len(self.backends):
             result.startTest(self)
             result.stopTest(self)
             raise SkipTest('No backends configured for this module.')
         TestCase.run(self, result)
     finally:
         self.weboob.deinit()
开发者ID:dasimon,项目名称:weboob,代码行数:18,代码来源:test.py

示例5: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
    def run(self, result):
        if not self.backend:
            result.startTest(self)
            result.stopTest(self)
            raise SkipTest()

        return TestCase.run(self, result)
开发者ID:jocelynj,项目名称:weboob,代码行数:9,代码来源:test.py

示例6: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
 def run(self, result):
     """
     Call the parent run() for each backend instance.
     Skip the test if we have no backends.
     """
     # This is a hack to fix an issue with nosetests running
     # with many tests. The default is 1000.
     sys.setrecursionlimit(10000)
     try:
         if not len(self.backends):
             self.backend = self.weboob.build_backend(self.MODULE, nofail=True)
             TestCase.run(self, result)
         else:
             # Run for all backend
             for backend_instance in self.backends.keys():
                 print(backend_instance)
                 self.backend = self.backends[backend_instance]
                 TestCase.run(self, result)
     finally:
         self.weboob.deinit()
开发者ID:laurentb,项目名称:weboob,代码行数:22,代码来源:test.py

示例7: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
    def run(self, result=None):
        testMethod = getattr(self, self._testMethodName);

        # gets the data provider method name
        try:
            providerName = getattr(testMethod, self.ATTR_METHOD_NAME);
        except AttributeError:
            return BaseTestCase.run(self, result);

        # call the data provider method for gets all datasets
        datas = getattr(self, providerName)();

        # runs the test with all datasets
        for dataId in range(len(datas)):
            # use the same behavior than the `TestSuite.run` method
            if result and result.shouldStop:
                break;

            # create a clone of the current instance with this data set
            that = type(self)(self._testMethodName, datas[dataId], dataId);

            BaseTestCase.run(that, result);
开发者ID:alquerci,项目名称:cyg-apt,代码行数:24,代码来源:__init__.py

示例8: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
    def run(self, result=None):
        """Runs the test.

        @param result: TestResult
        """
        assert None is result or isinstance(result, TestResult);

        if None is result :
            result = self.defaultTestResult();

        if not isinstance(result, _TestResultWrapper) :
            result = _TestResultWrapper(result);

        return BaseTestCase.run(self, result);
开发者ID:alquerci,项目名称:cyg-apt,代码行数:16,代码来源:__init__.py

示例9: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
 def run(self, *pos, **kw):
     import socket as socketmod
     def socket(*pos, **kw):
         raise self.DirectSocket("socket.socket() called")
     with substattr(socketmod, socket):
         return TestCase.run(self, *pos, **kw)
开发者ID:armadello,项目名称:python-iview,代码行数:8,代码来源:test.py

示例10: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
 def run(self, *args, **kwargs):
     if self.switch_expected == 'default':
         self.switch_expected = get_switch_expected(self.fullname)
     return BaseTestCase.run(self, *args, **kwargs)
开发者ID:Alex201310,项目名称:gevent,代码行数:6,代码来源:greentest.py

示例11: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
    def run(self):
        print("Running python tests")

        print("LEDs Tests")
        TestCase.run(TestLeds())
        print("____________________")

        print("Switches Tests")
        TestCase.run(TestSwitches())
        print("____________________")

        print("UART Tests")
        TestCase.run(TestUart())
        print("____________________")

        print("EEPROM Tests")
        TestCase.run(TestEEPROM())
        print("____________________")

        print("DAC Tests")
        TestCase.run(TestDAC())
        print("____________________")


        print("ADC Tests")
        TestCase.run(TestADC())
        print("____________________")

        print("GPIOs Tests")
        TestCase.run(TestGPIO())
        print("____________________")

        print("RS485 Tests")
        TestCase.run(TestRS485())
        print("____________________")

        print("Timers Tests")
        TestCase.run(TestTimers())
        print("____________________")



        print("Statistics:")
        TestCase.printStatistics()
开发者ID:martinribelotta,项目名称:micropython,代码行数:46,代码来源:MainTest.py

示例12: run

# 需要导入模块: from unittest import TestCase [as 别名]
# 或者: from unittest.TestCase import run [as 别名]
 def run(self, result=None):
   with StackContext(self._cleanup):
     TestCase.run(self, result)
开发者ID:thenaran,项目名称:clique,代码行数:5,代码来源:testing.py


注:本文中的unittest.TestCase.run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。