• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python unittest.findTestCases函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: suite

def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.findTestCases(test_util))
    suite.addTest(unittest.findTestCases(test_mythdb))
    suite.addTest(unittest.findTestCases(test_mythtv))
    suite.addTest(unittest.findTestCases(test_domain))
    suite.addTest(unittest.findTestCases(test_player))
    return suite
开发者ID:Bram77,项目名称:xbmc-favorites,代码行数:8,代码来源:runtests.py


示例2: unitTestSuite

def unitTestSuite():
    test_suite = unittest.TestSuite()
    test_suite.addTest(unittest.findTestCases(test_achievements))
    test_suite.addTest(unittest.findTestCases(test_game_store))
    test_suite.addTest(unittest.findTestCases(test_ladder))
    test_suite.addTest(unittest.findTestCases(test_pundit))
    test_suite.addTest(unittest.findTestCases(transforms))
    return test_suite
开发者ID:tredston,项目名称:TNTFL-web,代码行数:8,代码来源:run_tests.py


示例3: test_suite

def test_suite():
    from node.ext.ugm.tests import test_api
    from node.ext.ugm.tests import test_file

    suite = unittest.TestSuite()

    suite.addTest(unittest.findTestCases(test_api))
    suite.addTest(unittest.findTestCases(test_file))

    return suite
开发者ID:bluedynamics,项目名称:node.ext.ugm,代码行数:10,代码来源:__init__.py


示例4: test_suite

def test_suite():
    from cone.zodb.tests import test_common
    from cone.zodb.tests import test_entry
    from cone.zodb.tests import test_indexing
    from cone.zodb.tests import test_catalog

    suite = unittest.TestSuite()

    suite.addTest(unittest.findTestCases(test_common))
    suite.addTest(unittest.findTestCases(test_entry))
    suite.addTest(unittest.findTestCases(test_indexing))
    suite.addTest(unittest.findTestCases(test_catalog))

    return suite
开发者ID:bluedynamics,项目名称:cone.zodb,代码行数:14,代码来源:__init__.py


示例5: suite

def suite():
    modules_to_test = map( lambda x: x[:-3], glob.glob("tests/*.py" ))
    
    alltests = unittest.TestSuite()
    for module in map(__import__, modules_to_test):
        alltests.addTest(unittest.findTestCases(module))
    return alltests
开发者ID:pombredanne,项目名称:alignlib,代码行数:7,代码来源:test.py


示例6: buildSuite

def buildSuite():
    suite = unittest.TestSuite()
    for mod in map(__import__,
        [ os.path.basename(os.path.splitext(file)[0])
            for file in glob(testdir + '/*_test.py') ]):
        suite.addTest(unittest.findTestCases(mod)) 
    return suite
开发者ID:ecell,项目名称:object_matrix_standalone,代码行数:7,代码来源:runtest.py


示例7: suite

def suite():
	modules = ['testConnection', 'testConnectionManager', 'testPool', 'testQuery', 'testTransaction', 'testLogging']
	alltests = unittest.TestSuite()
	for module in map(__import__, modules):
		alltests.addTest(unittest.findTestCases(module))
		
	return alltests
开发者ID:EverythingMe,项目名称:PySQLPool,代码行数:7,代码来源:__init__.py


示例8: main

def main(options=None):
    op = options or optparse.OptionParser()
    op.add_option('-b', '--browser', dest='browser', default='ie', 
        help='Specify the browser to use [ie/firefox]')
    op.add_option('-u', '--url', dest='url', help='Specify the URL to load in the browser')
    op.add_option('-v', '--verbose', dest='verbose', action='store_true')
    op.add_option('-q', '--quiet', dest='quiet', action='store_true')

    # Blacklist of members of optparse.Values to ignore
    blacklist = dir(optparse.Values)

    opts, args = op.parse_args()
    kwargs = dict([(k, getattr(opts, k)) for k in dir(opts) if not k in blacklist])
    kwargs.pop('quiet')
    kwargs.pop('verbose')

    kwargs['verbosity'] = 1
    if opts.quiet:
        kwargs['verbosity'] = 0
    if opts.verbose:
        kwargs['verbosity'] = 2

    tests = unittest.findTestCases(sys.modules['__main__'])
    runner = WatinTestRunner(**kwargs)
    rc = runner.run(tests)
    if not rc.wasSuccessful():
        sys.exit(1)
开发者ID:Wombatpm,项目名称:IronWatin,代码行数:27,代码来源:IronWatin.py


示例9: suite

def suite():
    modules_to_test = (
        'sql.testtypes',
        'sql.columns',
        'sql.constraints',

        'sql.generative',

        # SQL syntax
        'sql.select',
        'sql.selectable',
        'sql.case_statement',
        'sql.labels',
        'sql.unicode',

        # assorted round-trip tests
        'sql.functions',
        'sql.query',
        'sql.quote',
        'sql.rowcount',

        # defaults, sequences (postgres/oracle)
        'sql.defaults',
        )
    alltests = unittest.TestSuite()
    for name in modules_to_test:
        mod = __import__(name)
        for token in name.split('.')[1:]:
            mod = getattr(mod, token)
        alltests.addTest(unittest.findTestCases(mod, suiteClass=None))
    return alltests
开发者ID:Frihet,项目名称:sqlalchemy-patches,代码行数:31,代码来源:alltests.py


示例10: main

def main(verbose):

    basenames = [
        "test_template",
        "test_engine",
        "test_preprocess",
        "test_htmlhelper",
        "test_main",
        "test_encoding",
        "test_users_guide",
        "test_faq",
        "test_examples",
    ]
    if python3:
        basenames.remove("test_encoding")

    if verbose:

        import os
        for basename in basenames:
            print('')
            print("************************************************* " + basename)
            os.system("python %s.py" % basename)

    else:

        import unittest
        suite = unittest.TestSuite()
        for basename in basenames:
            test_module = __import__(basename)
            suite.addTest(unittest.findTestCases(test_module))

        unittest.TextTestRunner(verbosity=1).run(suite)
开发者ID:mikedougherty,项目名称:tenjin,代码行数:33,代码来源:test_all.py


示例11: suite

def suite():
    """ Create a test suite for this module. """
    
    # We need to do some magic stuff here.  We want to load up all the test
    # cases twice: once for each setting of the bDomlette flag.  So we need
    # to get an explicit module reference, and load the cases manually.
    mod = sys.modules[__name__]
    suite = unittest.TestSuite()

    global bDomlette
    bDomlette = False
    suite.addTest(unittest.findTestCases(mod))

    bDomlette = True
    suite.addTest(unittest.findTestCases(mod))
    return suite
开发者ID:temp9999gi,项目名称:projectautomation,代码行数:16,代码来源:test_handyxml.py


示例12: suite

def suite():
    modules = ["testConnection", "testPool", "testQuery", "testTransaction", "testLogging"]
    alltests = unittest.TestSuite()
    for module in map(__import__, modules):
        alltests.addTest(unittest.findTestCases(module))

    return alltests
开发者ID:yzlin,项目名称:PySQLPool,代码行数:7,代码来源:__init__.py


示例13: suite

def suite():
    modules_to_test = ('LFSR_ut', 'Axis3_ut', 'Quaternion_ut', \
                       'Grid_ut', 'Map_ut', 'Ligand_ut', 'Dock_ut')
    alltests = unittest.TestSuite()
    for module in map(__import__, modules_to_test):
        alltests.addTest(unittest.findTestCases(module))
    return alltests
开发者ID:ekaakurniawan,项目名称:hppNeuroDock,代码行数:7,代码来源:ut.py


示例14: suite

def suite():
    modules_to_test = (
        'test_codes',
        'test_dataele',
        'test_map_if',
        'test_map_index',
        'test_map_unique',
        'test_map_walker',
        'test_params',
        'test_path',
        'test_rawx12file',
        'test_segment',
        'test_syntax',
        'test_validation',
        'test_x12context',
        'test_x12file',
        'test_x12n_document',
        'test_xmlwriter',
        'test_x12n_document',
        'test_xmlx12_simple',
    )
    alltests = unittest.TestSuite()
    for module in map(__import__, modules_to_test):
        alltests.addTest(unittest.findTestCases(module))
    return alltests
开发者ID:ajain76,项目名称:pyx12,代码行数:25,代码来源:test.py


示例15: suite

def suite():
    alltests = unittest.TestSuite()

    for mod in get_testmods():
        alltests.addTest(unittest.findTestCases(mod))
    
    return alltests
开发者ID:BackupTheBerlios,项目名称:pgpyp-svn,代码行数:7,代码来源:test_public.py


示例16: suite

def suite():
  modules_to_test = find_modules_and_add_paths(os.getcwd())
  alltests = unittest.TestSuite()
  for module in map(__import__, modules_to_test):
    alltests.addTest(unittest.findTestCases(module))

  return alltests
开发者ID:oan,项目名称:oand,代码行数:7,代码来源:test-all.py


示例17: run_test

def run_test():
    import sys

    sys.path.extend(["/home/rinze/dev/lib/Pyro4/src/",
                     "/home/rinze/dev/odemis/src",
                     "/home/rinze/dev/odemis/src/gui",
                     "/home/rinze/dev/misc/"])

    import unittest
    import os
    import logging

    import odemis.gui.test as test

    print "\n** Gathering all Odemis GUI TestCases...\n"

    alltests = unittest.TestSuite()

    path = os.path.dirname(os.path.realpath(__file__))

    for _, _, files in os.walk(path):
        modules_to_test = [x[:-3] for x in files if x.endswith('test.py')]

        for file_name in sorted(modules_to_test):
            print " * Adding module %s" % file_name
            module = __import__(file_name)
            logging.getLogger().setLevel(logging.ERROR)

            module.INSPECT = False
            module.MANUAL = False
            module.SLEEP_TIME = 10

            alltests.addTest(unittest.findTestCases(module))

    result = unittest.TestResult()

    test.INSPECT = False
    test.MANUAL = False
    test.SLEEP_TIME = 10

    print "\n** Running..."
    alltests.run(result)

    num_errors = len(result.errors)
    print "\n** %d Errors occured" % num_errors

    for error in result.errors:
        print "  * %s" % error[0]
        for line in error[1].splitlines():
            print "  %s" % line

    num_failures = len(result.failures)
    print "\n** %d Failures occured\n" % num_failures

    for failure in result.failures:
        print " * %s" % failure[0]
        for line in failure[1].splitlines():
            print "  %s" % line

    print "** Done."
开发者ID:ktsitsikas,项目名称:odemis,代码行数:60,代码来源:runall.py


示例18: main

def main(port, tests, verbosity):
    if not tests:
        tests = os.listdir(os.path.dirname(__file__))
        tests = [os.path.splitext(t)[0] for t in tests]

    # find files and the tests in them
    mainsuite = unittest.TestSuite()
    for modulename in tests:
        try:
            module = __import__(modulename)
        except ImportError:
            print("skipping %s" % modulename)
        else:
            module.PORT = port
            testsuite = unittest.findTestCases(module)
            print(
                "found %s tests in %r" %
                (testsuite.countTestCases(), modulename))
            mainsuite.addTest(testsuite)

    # run the collected tests
    testRunner = unittest.TextTestRunner(verbosity=verbosity)
    result = testRunner.run(mainsuite)

    # set exit code according to test results
    return (0 if result.wasSuccessful() else 1)
开发者ID:AeroEng43,项目名称:pyserial,代码行数:26,代码来源:run_all_tests.py


示例19: main

def main():
    parser = OptionParser(usage="%prog [options] [files]")
    add = parser.add_option
    add("--conf", dest="conf", metavar="CONF",
        help="set the conf file")
    add("--profile", dest="profile", action="store_true", default=False,
        help="turn on hotshot profiling")
    add("--dump", dest="dump", action="store_true", default=False,
        help="dump this script")
    add("--unittest", dest="unittest", action="store_true", default=False,
        help="run the python unittests")
    add("--quiet", dest="verbosity", action="store_const", const=0,
        help="minimal output")
    add("--verbose", dest="verbosity", action="store_const", const=2,
        help="verbose output")
    add("--help:conf", dest="showdefaultconf", action="store_true", default=False,
        help="display the default configuration file")
    parser.set_defaults(verbosity=1)
    options, args = parser.parse_args()

    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit()

    if options.showdefaultconf:
        print conf.DEFAULT_CONF
        sys.exit()

    conf_ = conf.Conf()
    if options.conf:
        conf_.loadfile(options.conf)

    profile_func = _profile_disabled
    if options.profile:
        profile_func = _profile_enabled

    if options.unittest:
        suite = unittest.TestSuite();
        for module in [conf, htmlparse, jsparse, lint, util]:
            suite.addTest(unittest.findTestCases(module))

        runner = unittest.TextTestRunner(verbosity=options.verbosity)
        runner.run(suite)

    paths = []
    for recurse, path in conf_['paths']:
        paths.extend(_resolve_paths(path, recurse))
    for arg in args:
        paths.extend(_resolve_paths(arg, False))
    if options.dump:
        profile_func(_dump, paths)
    else:
        profile_func(_lint, paths, conf_)

    if _lint_results['errors']:
        sys.exit(3)
    if _lint_results['warnings']:
        sys.exit(1)
    sys.exit(1)
开发者ID:christian-oudard,项目名称:jsl,代码行数:59,代码来源:jsl.py


示例20: suite

def suite():
    modules_to_test = ('config_settings_test',
                       'document_manipulator_test',
                       'localization_test')
    alltests = unittest.TestSuite()
    for module in map(__import__, modules_to_test):
        alltests.addTest(unittest.findTestCases(module))
    return alltests
开发者ID:dinkel,项目名称:gedit-whitespace-remover,代码行数:8,代码来源:alltests.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python unittest.getTestCaseNames函数代码示例发布时间:2022-05-27
下一篇:
Python unittest.expectedFailure函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap