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


Python unittest.TestSuite类代码示例

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


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

示例1: build_suite

    def build_suite(self, test_labels, extra_tests=None, **kwargs):
        '''
        Override the base class method to return a suite consisting of all
        TestCase subclasses throughought the whole project.
        '''
        if test_labels:
            suite = TestSuite()
        else:
            suite = DjangoTestSuiteRunner.build_suite(
                self, test_labels, extra_tests, **kwargs
            )
        added_test_classes = set(t.__class__ for t in suite)

        loader = TestLoader()
        for fname in _get_module_names(os.getcwd()):
            module = _import(_to_importable_name(fname))
            for test_class in _get_testcases(module):

                if test_class in added_test_classes:
                    continue

                for method_name in loader.getTestCaseNames(test_class):
                    testname = '.'.join([
                        module.__name__, test_class.__name__, method_name
                    ])
                    if self._test_matches(testname, test_labels):
                        suite.addTest(loader.loadTestsFromName(testname))
                        added_test_classes.add(test_class)

        return reorder_suite(suite, (TestCase,))
开发者ID:bloodearnest,项目名称:extending_unittest,代码行数:30,代码来源:all_dirs_runner.py

示例2: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(TestTutorialPageComments))
    if MockMailHost:
        suite.addTest(makeSuite(MockMailHostTests))
    return suite
开发者ID:chy-causer,项目名称:Products.PloneHelpCenter,代码行数:7,代码来源:testComments.py

示例3: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestSSOLogin))
    suite.addTest(makeSuite(TestSSOLoginIframe))
    return suite
开发者ID:rochecompaan,项目名称:Products.CMFPlone,代码行数:7,代码来源:testSSOLogin.py

示例4: test_suite

def test_suite():
    suite = TestSuite()
    suite.addTest(wkt.test_suite())
    suite.addTest(kml.test_suite())
    suite.addTest(gpx.test_suite())
    suite.addTest(csv.test_suite())
    return suite
开发者ID:ephemerallabs,项目名称:vectorformats,代码行数:7,代码来源:__init__.py

示例5: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    # Add our test class here - you can add more test classes if you wish,
    # and they will be run together.
    suite.addTest(makeSuite(TestTemplateCreation))
    return suite
开发者ID:collective,项目名称:Products.PloneTemplates,代码行数:7,代码来源:testTemplateCreation.py

示例6: additional_tests

def additional_tests():
    proj_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    readme_fn = os.path.join(proj_dir, 'README.txt')
    suite = TestSuite([doctest.DocTestSuite('pybloom.pybloom')])
    if os.path.exists(readme_fn):
        suite.addTest(doctest.DocFileSuite(readme_fn, module_relative=False))
    return suite
开发者ID:caidao,项目名称:zhihu_spider,代码行数:7,代码来源:filter_tests.py

示例7: loadTestsFromName

 def loadTestsFromName(self, name, module=None):
   suite = TestSuite()
   for test in findTests(name):
     sys.path.insert(0, name) # python3 compatibility
     suite.addTests(super(TestLoader, self).loadTestsFromName(test))
     del sys.path[0] # python3 compatibility
   return suite
开发者ID:smielgo99,项目名称:testRepo,代码行数:7,代码来源:test.py

示例8: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestCSSRegistry))
    suite.addTest(makeSuite(TestJSRegistry))
    return suite
开发者ID:rochecompaan,项目名称:Products.CMFPlone,代码行数:7,代码来源:testCSSandJSRegistry.py

示例9: test_suite

def test_suite():
    suite = TestSuite()
    import setsuden4trac.tests.reader
    suite.addTest(makeSuite(setsuden4trac.tests.reader.ReaderTests))
    import setsuden4trac.tests.core
    suite.addTest(makeSuite(setsuden4trac.tests.core.ComponentTests))
    return suite
开发者ID:nnabeyang,项目名称:setsuden4trac,代码行数:7,代码来源:__init__.py

示例10: suite

def suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(ModuleTests))

    return suite
开发者ID:VinayPrakashSingh,项目名称:plotdevice,代码行数:7,代码来源:module.py

示例11: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    from Products.LinguaPlone.tests import LinguaPloneTestCase
    LinguaPloneTestCase # PYFLAKES
    suite.addTest(makeSuite(TestWeblogTranslation))
    return suite
开发者ID:collective,项目名称:Products.Quills,代码行数:7,代码来源:test_weblogLinguaPlone.py

示例12: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestPortlet))
    suite.addTest(makeSuite(TestRenderer))
    return suite
开发者ID:mingtak,项目名称:nnsh.portlet.subfolderlist,代码行数:7,代码来源:test_portlet.py

示例13: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite

    suite = TestSuite()
    suite.addTest(makeSuite(TestHTTPHeaders))

    return suite
开发者ID:pigaov10,项目名称:plone4.3,代码行数:7,代码来源:testHTTPHeaders.py

示例14: test_suite

def test_suite():
    from unittest import TestSuite, makeSuite
    from Products.PloneTestCase.layer import ZCMLLayer
    suite = TestSuite()
    suite.layer = ZCMLLayer
    suite.addTest(makeSuite(TestCustomScript))
    return suite
开发者ID:sixfeetup,项目名称:Products.PloneFormGen,代码行数:7,代码来源:testSubmissionFolder.py

示例15: test_suite

def test_suite():
    """ Test suite
    """
    from unittest import TestSuite, makeSuite
    suite = TestSuite()
    suite.addTest(makeSuite(TestSomething))
    return suite
开发者ID:eea,项目名称:Products.EEAPloneAdmin,代码行数:7,代码来源:testSkeleton.py


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