本文整理汇总了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
示例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)
示例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)
示例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__
示例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)
示例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)
示例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
示例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)
示例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
示例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.
示例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)
示例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)
示例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)
示例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__])
示例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)