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


Python unittest.makeSuite方法代码示例

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


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

示例1: run_tests

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def run_tests(test_to_run, config=None):
    global CONFIG, STORAGE_CONFIG, STORAGE

    CONFIG = json.load(args.config) if config else default_config()
    STORAGE_CONFIG = extract_storage_config(CONFIG)
    STORAGE = InternalStorage(STORAGE_CONFIG).storage_handler

    suite = unittest.TestSuite()
    if test_to_run == 'all':
        suite.addTest(unittest.makeSuite(TestPywren))
    else:
        try:
            suite.addTest(TestPywren(test_to_run))
        except ValueError:
            print("unknown test, use: --help")
            sys.exit()

    runner = unittest.TextTestRunner()
    runner.run(suite) 
开发者ID:pywren,项目名称:pywren-ibm-cloud,代码行数:21,代码来源:tests.py

示例2: main

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def main():
    """Runs the suite of unit tests"""

    # Do the tests
    suite = unittest.TestSuite()
    suite.addTests(unittest.makeSuite(TestXnos))
    suite.addTests(unittest.makeSuite(TestPandocAttributes))
    result = unittest.TextTestRunner(verbosity=1).run(suite)
    n_errors = len(result.errors)
    n_failures = len(result.failures)

    if n_errors or n_failures:
        print('\n\nSummary: %d errors and %d failures reported\n'%\
            (n_errors, n_failures))

    print()

    sys.exit(n_errors+n_failures) 
开发者ID:tomduck,项目名称:pandoc-xnos,代码行数:20,代码来源:test.py

示例3: test_suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def test_suite():
    suite = unittest.TestSuite()

    suite.addTest(unittest.makeSuite(AssociateErrorTestCase))

    suite.addTest(unittest.makeSuite(AssociateHashTestCase))
    suite.addTest(unittest.makeSuite(AssociateBTreeTestCase))
    suite.addTest(unittest.makeSuite(AssociateRecnoTestCase))

    suite.addTest(unittest.makeSuite(AssociateBTreeTxnTestCase))

    suite.addTest(unittest.makeSuite(ShelveAssociateHashTestCase))
    suite.addTest(unittest.makeSuite(ShelveAssociateBTreeTestCase))
    suite.addTest(unittest.makeSuite(ShelveAssociateRecnoTestCase))

    if have_threads:
        suite.addTest(unittest.makeSuite(ThreadedAssociateHashTestCase))
        suite.addTest(unittest.makeSuite(ThreadedAssociateBTreeTestCase))
        suite.addTest(unittest.makeSuite(ThreadedAssociateRecnoTestCase))

    return suite 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:23,代码来源:test_associate.py

示例4: test_suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def test_suite():
    suite = unittest.TestSuite()

    if have_threads:
        suite.addTest(unittest.makeSuite(BTreeConcurrentDataStore))
        suite.addTest(unittest.makeSuite(HashConcurrentDataStore))
        suite.addTest(unittest.makeSuite(BTreeSimpleThreaded))
        suite.addTest(unittest.makeSuite(HashSimpleThreaded))
        suite.addTest(unittest.makeSuite(BTreeThreadedTransactions))
        suite.addTest(unittest.makeSuite(HashThreadedTransactions))
        suite.addTest(unittest.makeSuite(BTreeThreadedNoWaitTransactions))
        suite.addTest(unittest.makeSuite(HashThreadedNoWaitTransactions))

    else:
        print "Threads not available, skipping thread tests."

    return suite 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:19,代码来源:test_thread.py

示例5: test_suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def test_suite():
    suite = unittest.TestSuite()
    if db.version() >= (4, 6) :
        dbenv = db.DBEnv()
        try :
            dbenv.repmgr_get_ack_policy()
            ReplicationManager_available=True
        except :
            ReplicationManager_available=False
        dbenv.close()
        del dbenv
        if ReplicationManager_available :
            suite.addTest(unittest.makeSuite(DBReplicationManager))

        if have_threads :
            suite.addTest(unittest.makeSuite(DBBaseReplication))

    return suite 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:20,代码来源:test_replication.py

示例6: suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def suite():
    test_list = tests('input', 'messages')

    if module_exists('rest_framework'):
        test_list += tests('external_drf', '')

    return unittest.TestSuite(
        [unittest.makeSuite(test, suiteClass=unittest.TestSuite)
         for test in test_list]) 
开发者ID:jschaf,项目名称:pylint-flask,代码行数:11,代码来源:test_func.py

示例7: run_unittest

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def run_unittest(*classes):
    """Run tests from unittest.TestCase-derived classes."""
    valid_types = (unittest.TestSuite, unittest.TestCase)
    suite = unittest.TestSuite()
    for cls in classes:
        if isinstance(cls, str):
            if cls in sys.modules:
                suite.addTest(unittest.findTestCases(sys.modules[cls]))
            else:
                raise ValueError("str arguments must be keys in sys.modules")
        elif isinstance(cls, valid_types):
            suite.addTest(cls)
        else:
            suite.addTest(unittest.makeSuite(cls))
    def case_pred(test):
        if match_tests is None:
            return True
        for name in test.id().split("."):
            if fnmatch.fnmatchcase(name, match_tests):
                return True
        return False
    _filter_suite(suite, case_pred)
    _run_suite(suite)

#=======================================================================
# Check for the presence of docstrings. 
开发者ID:war-and-code,项目名称:jawfish,代码行数:28,代码来源:support.py

示例8: testsuite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def testsuite():
    t1 = unittest.makeSuite(FeatureStructureTestCase)
    return unittest.TestSuite( (t1,) ) 
开发者ID:rafasashi,项目名称:razzy-spinner,代码行数:5,代码来源:featurestructure.py

示例9: testsuite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def testsuite():
    suite = unittest.makeSuite(TestModels)
    return unittest.TestSuite(suite) 
开发者ID:rafasashi,项目名称:razzy-spinner,代码行数:5,代码来源:evaluate.py

示例10: run_unittest

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def run_unittest(*classes):
    """Run tests from unittest.TestCase-derived classes."""
    valid_types = (unittest.TestSuite, unittest.TestCase)
    suite = unittest.TestSuite()
    for cls in classes:
        if isinstance(cls, str):
            if cls in sys.modules:
                suite.addTest(unittest.findTestCases(sys.modules[cls]))
            else:
                raise ValueError("str arguments must be keys in sys.modules")
        elif isinstance(cls, valid_types):
            suite.addTest(cls)
        else:
            suite.addTest(unittest.makeSuite(cls))
    def case_pred(test):
        if match_tests is None:
            return True
        for name in test.id().split("."):
            if fnmatch.fnmatchcase(name, match_tests):
                return True
        return False
    _filter_suite(suite, case_pred)
    _run_suite(suite)

# We don't have sysconfig on Py2.6:
# #=======================================================================
# # Check for the presence of docstrings.
# 
# HAVE_DOCSTRINGS = (check_impl_detail(cpython=False) or
#                    sys.platform == 'win32' or
#                    sysconfig.get_config_var('WITH_DOC_STRINGS'))
# 
# requires_docstrings = unittest.skipUnless(HAVE_DOCSTRINGS,
#                                           "test requires docstrings")
# 
# 
# #=======================================================================
# doctest driver. 
开发者ID:Soft8Soft,项目名称:verge3d-blender-addon,代码行数:40,代码来源:support.py

示例11: tests

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def tests():
    from test import rlite, persistent

    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(rlite.RliteTest))
    suite.addTest(unittest.makeSuite(persistent.PersistentTest))

    try:
        from test import patch
        suite.addTest(unittest.makeSuite(patch.PatchConnTest))
        suite.addTest(unittest.makeSuite(patch.PatchContextManagerTest))
    except ImportError:
        pass

    return suite 
开发者ID:seppo0010,项目名称:rlite-py,代码行数:17,代码来源:__init__.py

示例12: test_suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def test_suite():
    suite = unittest.makeSuite(TestSmartDL)
    return suite 
开发者ID:iTaybb,项目名称:pySmartDL,代码行数:5,代码来源:test_pySmartDL.py

示例13: suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(MarkupTestCase))

    # this test only tests the c extension
    if not hasattr(escape, 'func_code'):
        suite.addTest(unittest.makeSuite(MarkupLeakTestCase))

    return suite 
开发者ID:jpush,项目名称:jbox,代码行数:11,代码来源:tests.py

示例14: suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def suite():
    default_suite = unittest.makeSuite(TransactionTests, "Check")
    special_command_suite = unittest.makeSuite(SpecialCommandTests, "Check")
    return unittest.TestSuite((default_suite, special_command_suite)) 
开发者ID:vmware-archive,项目名称:vsphere-storage-for-docker,代码行数:6,代码来源:transactions.py

示例15: suite

# 需要导入模块: import unittest [as 别名]
# 或者: from unittest import makeSuite [as 别名]
def suite():
    module_suite = unittest.makeSuite(ModuleTests, "Check")
    connection_suite = unittest.makeSuite(ConnectionTests, "Check")
    cursor_suite = unittest.makeSuite(CursorTests, "Check")
    thread_suite = unittest.makeSuite(ThreadTests, "Check")
    constructor_suite = unittest.makeSuite(ConstructorTests, "Check")
    ext_suite = unittest.makeSuite(ExtensionTests, "Check")
    closed_con_suite = unittest.makeSuite(ClosedConTests, "Check")
    closed_cur_suite = unittest.makeSuite(ClosedCurTests, "Check")
    return unittest.TestSuite((module_suite, connection_suite, cursor_suite, thread_suite, constructor_suite, ext_suite, closed_con_suite, closed_cur_suite)) 
开发者ID:vmware-archive,项目名称:vsphere-storage-for-docker,代码行数:12,代码来源:dbapi.py


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