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


Python doctest.DocTestSuite方法代码示例

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


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

示例1: test_main

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def test_main():
    suite = unittest.TestSuite()
    suite.addTest(DocTestSuite('_threading_local'))
    suite.addTest(unittest.makeSuite(ThreadLocalTest))
    suite.addTest(unittest.makeSuite(PyThreadingLocalTest))

    try:
        from thread import _local
    except ImportError:
        pass
    else:
        import _threading_local
        local_orig = _threading_local.local
        def setUp(test):
            _threading_local.local = _local
        def tearDown(test):
            _threading_local.local = local_orig
        suite.addTest(DocTestSuite('_threading_local',
                                   setUp=setUp, tearDown=tearDown)
                      )

    test_support.run_unittest(suite) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:24,代码来源:test_threading_local.py

示例2: load_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def load_tests(loader, tests, *args):
    for _, name, _ in pkgutil.walk_packages(n6sdk._ABS_PATH):
        try:
            mod_suite = doctest.DocTestSuite(name)
        except ValueError as exc:
            try:
                msg = getattr(exc, 'args', ())[1]
            except (IndexError, TypeError):
                msg = None
            if msg != 'has no tests':
                raise
        else:
            tests.addTests(mod_suite)
    return tests


# dissuade nose from using that function
# (note that nose has its own ways to discover doctests) 
开发者ID:CERT-Polska,项目名称:n6,代码行数:20,代码来源:test_doctests.py

示例3: make_suite

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def make_suite():  # pragma: no cover
    import calmjs.registry
    test_loader = unittest.TestLoader()
    test_suite = test_loader.discover(
        'calmjs.tests', pattern='test_*.py',
        top_level_dir=dirname(__file__),
    )
    # setting up the finder is a bit annoying for just a one-off.
    test_suite.addTest(doctest.DocTestSuite(calmjs.registry))
    return test_suite 
开发者ID:calmjs,项目名称:calmjs,代码行数:12,代码来源:__init__.py

示例4: doctests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def doctests():
    import doctest
    return doctest.DocTestSuite() 
开发者ID:tao12345666333,项目名称:tornado-zh,代码行数:5,代码来源:httputil.py

示例5: load_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def load_tests(loader, tests, ignore):
    tests.addTests(DocTestSuite(knx))
    return tests 
开发者ID:mfussenegger,项目名称:knx,代码行数:5,代码来源:tests.py

示例6: additional_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def additional_tests(suite=None):
    import simplejson
    import simplejson.encoder
    import simplejson.decoder
    if suite is None:
        suite = unittest.TestSuite()
    for mod in (simplejson, simplejson.encoder, simplejson.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(doctest.DocFileSuite('../../index.rst'))
    return suite 
开发者ID:gkudos,项目名称:qgis-cartodb,代码行数:12,代码来源:__init__.py

示例7: load_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def load_tests(loader, tests, ignore):
    # Add the doctests
    tests.addTests(DocTestSuite('more_itertools.recipes'))
    return tests 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:6,代码来源:test_recipes.py

示例8: load_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def load_tests(loader, tests, ignore):
    # Add the doctests
    tests.addTests(DocTestSuite('more_itertools.more'))
    return tests 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:6,代码来源:test_more.py

示例9: load_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def load_tests(loader, tests, ignore):
    tests.addTests(doctest.DocTestSuite(corpus))
    return tests 
开发者ID:alvations,项目名称:sacremoses,代码行数:5,代码来源:test_corpus.py

示例10: test_suite

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def test_suite():
    return doctest.DocTestSuite() 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:4,代码来源:test_regression.py

示例11: load_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def load_tests(loader, tests, ignore):
    tests.addTests(doctest.DocTestSuite(doctest_module))
    return tests 
开发者ID:PacktPublishing,项目名称:Clean-Code-in-Python,代码行数:5,代码来源:doctest_module_test.py

示例12: test_suite

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def test_suite():
    return doctest.DocTestSuite(distutils.versionpredicate) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:4,代码来源:test_versionpredicate.py

示例13: additional_tests

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def additional_tests():
    suite = unittest.TestSuite()
    for mod in (json, json.encoder, json.decoder):
        suite.addTest(doctest.DocTestSuite(mod))
    suite.addTest(TestPyTest('test_pyjson'))
    suite.addTest(TestCTest('test_cjson'))
    return suite 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:9,代码来源:__init__.py

示例14: test_main

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def test_main(verbose=None):
    import doctest
    from test import test_sets
    test_support.run_unittest(
        TestSetOfSets,
        TestExceptionPropagation,
        TestBasicOpsEmpty,
        TestBasicOpsSingleton,
        TestBasicOpsTuple,
        TestBasicOpsTriple,
        TestBinaryOps,
        TestUpdateOps,
        TestMutate,
        TestSubsetEqualEmpty,
        TestSubsetEqualNonEmpty,
        TestSubsetEmptyNonEmpty,
        TestSubsetPartial,
        TestSubsetNonOverlap,
        TestOnlySetsNumeric,
        TestOnlySetsDict,
        TestOnlySetsOperator,
        TestOnlySetsTuple,
        TestOnlySetsString,
        TestOnlySetsGenerator,
        TestOnlySetsofSets,
        TestCopyingEmpty,
        TestCopyingSingleton,
        TestCopyingTriple,
        TestCopyingTuple,
        TestCopyingNested,
        TestIdentities,
        doctest.DocTestSuite(test_sets),
    ) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:35,代码来源:test_sets.py

示例15: test_main

# 需要导入模块: import doctest [as 别名]
# 或者: from doctest import DocTestSuite [as 别名]
def test_main():
    difflib.HtmlDiff._default_prefix = 0
    Doctests = doctest.DocTestSuite(difflib)
    run_unittest(
        TestWithAscii, TestAutojunk, TestSFpatches, TestSFbugs,
        TestOutputFormat, TestJunkAPIs) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:8,代码来源:test_difflib.py


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