本文整理汇总了Python中test.test_support.run_unittest方法的典型用法代码示例。如果您正苦于以下问题:Python test_support.run_unittest方法的具体用法?Python test_support.run_unittest怎么用?Python test_support.run_unittest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.test_support
的用法示例。
在下文中一共展示了test_support.run_unittest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest,
UDPTimeoutTest ]
tests.extend([
NonBlockingTCPTests,
FileObjectClassTestCase,
FileObjectInterruptedTestCase,
UnbufferedFileObjectClassTestCase,
LineBufferedFileObjectClassTestCase,
SmallBufferedFileObjectClassTestCase,
Urllib2FileobjectTest,
NetworkConnectionNoServer,
NetworkConnectionAttributesTest,
NetworkConnectionBehaviourTest,
])
tests.append(BasicSocketPairTest)
tests.append(TestLinuxAbstractNamespace)
tests.extend([TIPCTest, TIPCThreadableTest])
thread_info = test_support.threading_setup()
test_support.run_unittest(*tests)
test_support.threading_cleanup(*thread_info)
示例2: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main(verbose=None):
test_classes = (
TestPartial,
TestPartialSubclass,
TestPythonPartial,
TestUpdateWrapper,
TestTotalOrdering,
TestWraps,
TestReduce,
)
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
示例3: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
import warnings
with warnings.catch_warnings():
warnings.filterwarnings('ignore', ".*urllib\.urlopen.*Python 3.0",
DeprecationWarning)
test_support.run_unittest(
urlopen_FileTests,
urlopen_HttpTests,
urlretrieve_FileTests,
urlretrieve_HttpTests,
ProxyTests,
QuotingTests,
UnquotingTests,
urlencode_Tests,
Pathname_Tests,
Utility_Tests,
URLopener_Tests,
ProxyTests,
ProxyTests_withOrderedEnv,
#FTPWrapperTests,
)
示例4: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
support.run_unittest(TestRlcompleter)
def test_duplicate_globals(self):
namespace = {
'False': None, # Keyword vs builtin vs namespace
'assert': None, # Keyword vs namespace
'try': lambda: None, # Keyword vs callable
'memoryview': None, # Callable builtin vs non-callable
'Ellipsis': lambda: None, # Non-callable builtin vs callable
}
completer = rlcompleter.Completer(namespace)
self.assertEqual(completer.complete('False', 0), 'False')
self.assertIsNone(completer.complete('False', 1)) # No duplicates
self.assertEqual(completer.complete('assert', 0), 'assert')
self.assertIsNone(completer.complete('assert', 1))
self.assertEqual(completer.complete('try', 0), 'try')
self.assertIsNone(completer.complete('try', 1))
# No opening bracket "(" because we overrode the built-in class
self.assertEqual(completer.complete('memoryview', 0), 'memoryview')
self.assertIsNone(completer.complete('memoryview', 1))
self.assertEqual(completer.complete('Ellipsis', 0), 'Ellipsis(')
self.assertIsNone(completer.complete('Ellipsis', 1))
示例5: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
test_support.run_unittest(
cPickleTests,
cStringIOCUnpicklerTests,
BytesIOCUnpicklerTests,
FileIOCUnpicklerTests,
cStringIOCPicklerTests,
BytesIOCPicklerTests,
FileIOCPicklerTests,
cStringIOCPicklerListTests,
BytesIOCPicklerListTests,
FileIOCPicklerListTests,
cStringIOCPicklerFastTests,
BytesIOCPicklerFastTests,
FileIOCPicklerFastTests,
cPickleDeepRecursive,
cPicklePicklerUnpicklerObjectTests,
cPickleBigmemPickleTests,
)
示例6: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main(verbose=None):
import sys
from test import test_support
test_classes = (TestTranforms,)
with test_support.check_py3k_warnings(
("backquote not supported", SyntaxWarning)):
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
示例7: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
test_support.run_unittest(
ZoneFileTests
)
示例8: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
support.run_unittest(CBufferSizeTest, PyBufferSizeTest, BuiltinBufferSizeTest)
示例9: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
with test_support.check_py3k_warnings(
("tuple parameter unpacking has been removed", SyntaxWarning),
("parenthesized argument names are invalid", SyntaxWarning)):
test_support.run_unittest(ComplexArgsTestCase)
示例10: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
with test_support.check_py3k_warnings(("buffer.. not supported",
DeprecationWarning)):
test_support.run_unittest(BufferTests)
示例11: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
with test_support.DirsOnSysPath(lib_tk_test):
test_support.run_unittest(
*runtktests.get_tests(text=False, packages=['test_ttk']))
示例12: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
test_support.run_unittest(PopenTest)
示例13: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
test_support.run_unittest(FnmatchTestCase, TranslateTestCase, FilterTestCase)
示例14: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
test_support.run_unittest(TestPrint)
示例15: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import run_unittest [as 别名]
def test_main():
test_support.run_unittest(NetrcTestCase)