本文整理汇总了Python中test.support.threading_cleanup方法的典型用法代码示例。如果您正苦于以下问题:Python support.threading_cleanup方法的具体用法?Python support.threading_cleanup怎么用?Python support.threading_cleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.support
的用法示例。
在下文中一共展示了support.threading_cleanup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def setUp(self):
self.done_mutex = thread.allocate_lock()
self.done_mutex.acquire()
self.running_mutex = thread.allocate_lock()
self.random_mutex = thread.allocate_lock()
self.created = 0
self.running = 0
self.next_ident = 0
key = support.threading_setup()
self.addCleanup(support.threading_cleanup, *key)
示例2: tearDown
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDown(self):
# Stop threads
self.stop = 1
for thread in self.threads:
thread.join()
thread = None
del self.threads[:]
support.threading_cleanup(*self._threading_key)
示例3: test_main
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def test_main():
tests = [TestFTPClass, TestTimeouts,
TestIPv6Environment,
TestTLS_FTPClassMixin, TestTLS_FTPClass]
thread_info = support.threading_setup()
try:
support.run_unittest(*tests)
finally:
support.threading_cleanup(*thread_info)
示例4: tearDownModule
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDownModule():
if threads_key:
support.threading_cleanup(threads_key)
示例5: tearDown
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDown(self):
support.threading_cleanup(*self._threads)
support.reap_children()
示例6: test_main
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def test_main():
tests = [TestPOP3Class, TestTimeouts,
TestPOP3_SSLClass, TestPOP3_TLSClass]
thread_info = test_support.threading_setup()
try:
test_support.run_unittest(*tests)
finally:
test_support.threading_cleanup(*thread_info)
示例7: tearDownClass
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDownClass(cls):
support.threading_cleanup(*cls.key)
support.unlink(support.TESTFN)
示例8: tearDown
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDown(self):
self.client.close()
self.evt.wait()
# Disable server feedback
DocXMLRPCServer._send_traceback_header = False
support.threading_cleanup(*self._threads)
示例9: tearDown
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDown(self):
support.threading_cleanup(*self._threads)
示例10: tearDown
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDown(self):
self.unpatch_get_running_loop()
events.set_event_loop(None)
# Detect CPython bug #23353: ensure that yield/yield-from is not used
# in an except block of a generator
self.assertEqual(sys.exc_info(), (None, None, None))
self.doCleanups()
support.threading_cleanup(*self._thread_cleanup)
support.reap_children()
示例11: test_main
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def test_main():
tests = [TestFTPClass, TestTimeouts, TestNetrcDeprecation,
TestIPv6Environment,
TestTLS_FTPClassMixin, TestTLS_FTPClass]
thread_info = support.threading_setup()
try:
support.run_unittest(*tests)
finally:
support.threading_cleanup(*thread_info)
示例12: tearDown
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDown(self):
self.thread.stop()
self.thread = None
os.environ.__exit__()
support.threading_cleanup(*self._threads)
示例13: test_main
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def test_main():
tests = [TestFTPClass, TestTimeouts,
TestIPv6Environment,
TestTLS_FTPClassMixin, TestTLS_FTPClass,
MiscTestCase]
thread_info = support.threading_setup()
try:
support.run_unittest(*tests)
finally:
support.threading_cleanup(*thread_info)
示例14: tearDownModule
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def tearDownModule():
if threads_key:
support.threading_cleanup(*threads_key)
示例15: test_main
# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_cleanup [as 别名]
def test_main():
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest, UDPTimeoutTest ]
tests.extend([
NonBlockingTCPTests,
FileObjectClassTestCase,
UnbufferedFileObjectClassTestCase,
LineBufferedFileObjectClassTestCase,
SmallBufferedFileObjectClassTestCase,
UnicodeReadFileObjectClassTestCase,
UnicodeWriteFileObjectClassTestCase,
UnicodeReadWriteFileObjectClassTestCase,
NetworkConnectionNoServer,
NetworkConnectionAttributesTest,
NetworkConnectionBehaviourTest,
ContextManagersTest,
InheritanceTest,
NonblockConstantTest
])
tests.append(BasicSocketPairTest)
tests.append(TestUnixDomain)
tests.append(TestLinuxAbstractNamespace)
tests.extend([TIPCTest, TIPCThreadableTest])
tests.extend([BasicCANTest, CANTest])
tests.extend([BasicRDSTest, RDSTest])
tests.extend([
CmsgMacroTests,
SendmsgUDPTest,
RecvmsgUDPTest,
RecvmsgIntoUDPTest,
SendmsgUDP6Test,
RecvmsgUDP6Test,
RecvmsgRFC3542AncillaryUDP6Test,
RecvmsgIntoRFC3542AncillaryUDP6Test,
RecvmsgIntoUDP6Test,
SendmsgTCPTest,
RecvmsgTCPTest,
RecvmsgIntoTCPTest,
SendmsgSCTPStreamTest,
RecvmsgSCTPStreamTest,
RecvmsgIntoSCTPStreamTest,
SendmsgUnixStreamTest,
RecvmsgUnixStreamTest,
RecvmsgIntoUnixStreamTest,
RecvmsgSCMRightsStreamTest,
RecvmsgIntoSCMRightsStreamTest,
# These are slow when setitimer() is not available
InterruptedRecvTimeoutTest,
InterruptedSendTimeoutTest,
TestSocketSharing,
SendfileUsingSendTest,
SendfileUsingSendfileTest,
])
thread_info = support.threading_setup()
support.run_unittest(*tests)
support.threading_cleanup(*thread_info)