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


Python test_support.run_doctest方法代码示例

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


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

示例1: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    from test import test_bisect

    test_classes = [TestBisectPython, TestBisectC,
                    TestInsortPython, TestInsortC,
                    TestErrorHandlingPython, TestErrorHandlingC]

    test_support.run_unittest(*test_classes)
    test_support.run_doctest(test_bisect, verbose)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:21,代码来源:test_bisect.py

示例2: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main():
    # Check the doctest cases in doctest itself:
    test_support.run_doctest(doctest, verbosity=True)

    from test import test_doctest

    # Ignore all warnings about the use of class Tester in this module.
    deprecations = []
    if __debug__:
        deprecations.append(("class Tester is deprecated", DeprecationWarning))
    if sys.py3kwarning:
        deprecations += [("backquote not supported", SyntaxWarning),
                         ("execfile.. not supported", DeprecationWarning)]
    with test_support.check_warnings(*deprecations):
        # Check the doctest cases defined here:
        test_support.run_doctest(test_doctest, verbosity=True) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:18,代码来源:test_doctest.py

示例3: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
                    RegressionTests, LengthTransparency,
                    SubclassWithKwargsTest, TestExamples,
                    TestPurePythonRoughEquivalents)
    test_support.run_unittest(*test_classes)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts

    # doctest the examples in the library reference
    test_support.run_doctest(sys.modules[__name__], verbose) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:21,代码来源:test_itertools.py

示例4: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main():
    from test import test_xml_etree, test_xml_etree_c

    # Run the tests specific to the C implementation
    test_support.run_doctest(test_xml_etree_c, verbosity=True)

    # Assign the C implementation before running the doctests
    # Patch the __name__, to prevent confusion with the pure Python test
    pyET = test_xml_etree.ET
    py__name__ = test_xml_etree.__name__
    test_xml_etree.ET = cET
    if __name__ != '__main__':
        test_xml_etree.__name__ = __name__
    try:
        # Run the same test suite as xml.etree.ElementTree
        test_xml_etree.test_main(module_name='xml.etree.cElementTree')
    finally:
        test_xml_etree.ET = pyET
        test_xml_etree.__name__ = py__name__ 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:21,代码来源:test_xml_etree_c.py

示例5: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
                    RegressionTests, LengthTransparency,
                    SubclassWithKwargsTest, TestExamples)
    test_support.run_unittest(*test_classes)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts

    # doctest the examples in the library reference
    test_support.run_doctest(sys.modules[__name__], verbose) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:20,代码来源:test_itertools.py

示例6: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    import sys
    test_classes = (
        TestBasic,
        TestVariousIteratorArgs,
        TestSubclass,
        TestSubclassWithKwargs,
    )

    test_support.run_unittest(*test_classes)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts

    # doctests
    from test import test_deque
    test_support.run_doctest(test_deque, verbose) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:26,代码来源:test_deque.py

示例7: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    from test import test_bisect
    from types import BuiltinFunctionType
    import sys

    test_classes = [TestBisect, TestInsort]
    if isinstance(bisect_left, BuiltinFunctionType):
        test_classes.append(TestErrorHandling)

    test_support.run_unittest(*test_classes)
    test_support.run_doctest(test_bisect, verbose)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:23,代码来源:test_bisect.py

示例8: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
                    RegressionTests, LengthTransparency)
    test_support.run_unittest(*test_classes)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_unittest(*test_classes)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts

    # doctest the examples in the library reference
    test_support.run_doctest(sys.modules[__name__], verbose) 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:19,代码来源:test_itertools.py

示例9: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    import sys
    from test import test_support
    from test import test_genexps
    test_support.run_doctest(test_genexps, verbose)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in xrange(len(counts)):
            test_support.run_doctest(test_genexps, verbose)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print counts 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:17,代码来源:test_genexps.py

示例10: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    # Obscure:  import this module as test.test_descrtut instead of as
    # plain test_descrtut because the name of this module works its way
    # into the doctest examples, and unless the full test.test_descrtut
    # business is used the name can change depending on how the test is
    # invoked.
    from test import test_support, test_descrtut
    test_support.run_doctest(test_descrtut, verbose)

# This part isn't needed for regrtest, but for running the test directly. 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:12,代码来源:test_descrtut.py

示例11: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=False):
    from test import test_support
    from test import test_unpack
    test_support.run_doctest(test_unpack, verbose) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:test_unpack.py

示例12: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    NamedTupleDocs = doctest.DocTestSuite(module=collections)
    test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
                    TestCollectionABCs, TestCounter]
    test_support.run_unittest(*test_classes)
    test_support.run_doctest(collections, verbose) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:8,代码来源:test_collections.py

示例13: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main():
    test_support.run_unittest(OptimizedPickleTests)
    test_support.run_doctest(pickletools) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:5,代码来源:test_pickletools.py

示例14: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main():
    test_support.run_unittest(
        ReferencesTestCase,
        MappingTestCase,
        WeakValueDictionaryTestCase,
        WeakKeyDictionaryTestCase,
        SubclassableWeakrefTestCase,
        )
    test_support.run_doctest(sys.modules[__name__]) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:11,代码来源:test_weakref.py

示例15: test_main

# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_doctest [as 别名]
def test_main(verbose=None):
    import sys
    from test import test_support
    from test import test_setcomps
    test_support.run_doctest(test_setcomps, verbose)

    # verify reference counting
    if verbose and hasattr(sys, "gettotalrefcount"):
        import gc
        counts = [None] * 5
        for i in range(len(counts)):
            test_support.run_doctest(test_setcomps, verbose)
            gc.collect()
            counts[i] = sys.gettotalrefcount()
        print(counts) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:17,代码来源:test_setcomps.py


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