本文整理汇总了Python中test.test_support.threading_cleanup方法的典型用法代码示例。如果您正苦于以下问题:Python test_support.threading_cleanup方法的具体用法?Python test_support.threading_cleanup怎么用?Python test_support.threading_cleanup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.test_support
的用法示例。
在下文中一共展示了test_support.threading_cleanup方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [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 threading_cleanup [as 别名]
def test_main():
tests = [TestFTPClass, TestTimeouts]
if socket.has_ipv6:
try:
DummyFTPServer((HOST, 0), af=socket.AF_INET6)
except socket.error:
pass
else:
tests.append(TestIPv6Environment)
if ssl is not None:
tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass])
thread_info = test_support.threading_setup()
try:
test_support.run_unittest(*tests)
finally:
test_support.threading_cleanup(*thread_info)
示例3: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def test_main():
tests = [TestFTPClass, TestTimeouts,
TestIPv6Environment,
TestTLS_FTPClassMixin, TestTLS_FTPClass]
thread_info = test_support.threading_setup()
try:
test_support.run_unittest(*tests)
finally:
test_support.threading_cleanup(*thread_info)
示例4: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown(self):
self.evt.wait()
self.thread.join()
test_support.threading_cleanup(*self._threads)
示例5: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown(self):
self.doCleanups()
test_support.threading_cleanup(*self._threads)
示例6: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown(self):
if self.f:
try:
self.f.close()
except (EnvironmentError, ValueError):
pass
try:
os.remove(self.filename)
except EnvironmentError:
pass
test_support.threading_cleanup(*self._threads)
示例7: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown(self):
support.threading_cleanup(*self._threads)
support.reap_children()
示例8: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown(self):
self.thread.stop()
os.environ.__exit__()
test_support.threading_cleanup(*self._threads)
示例9: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown (self):
test_support.threading_cleanup(*self._threads)
示例10: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [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,
])
if hasattr(socket, "socketpair"):
tests.append(BasicSocketPairTest)
if sys.platform == 'linux2':
tests.append(TestLinuxAbstractNamespace)
if isTipcAvailable():
tests.append(TIPCTest)
tests.append(TIPCThreadableTest)
thread_info = test_support.threading_setup()
test_support.run_unittest(*tests)
test_support.threading_cleanup(*thread_info)
示例11: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown(self):
test_support.threading_cleanup(*self._threads)
示例12: test_main
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def test_main(verbose=False):
global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, NOKIACERT
CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
"keycert.pem")
SVN_PYTHON_ORG_ROOT_CERT = os.path.join(
os.path.dirname(__file__) or os.curdir,
"https_svn_python_org_root.pem")
NOKIACERT = os.path.join(os.path.dirname(__file__) or os.curdir,
"nokia.pem")
if (not os.path.exists(CERTFILE) or
not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT) or
not os.path.exists(NOKIACERT)):
raise test_support.TestFailed("Can't read certificate files!")
tests = [BasicTests, BasicSocketTests]
if test_support.is_resource_enabled('network'):
tests.append(NetworkedTests)
if _have_threads:
thread_info = test_support.threading_setup()
if thread_info and test_support.is_resource_enabled('network'):
tests.append(ThreadedTests)
try:
test_support.run_unittest(*tests)
finally:
if _have_threads:
test_support.threading_cleanup(*thread_info)
示例13: tearDown
# 需要导入模块: from test import test_support [as 别名]
# 或者: from test.test_support import threading_cleanup [as 别名]
def tearDown(self):
self.client.close()
self.evt.wait()
# Disable server feedback
DocXMLRPCServer._send_traceback_header = False
test_support.threading_cleanup(*self._threads)