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


Python test_support.threading_cleanup方法代码示例

本文整理汇总了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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:26,代码来源:test_socket.py

示例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) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:20,代码来源:test_ftplib.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:12,代码来源:test_ftplib.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:test_smtplib.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:5,代码来源:test_urllib2_localnet.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:test_file2k.py

示例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() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:5,代码来源:lock_tests.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:test_httpservers.py

示例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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:4,代码来源:test_asynchat.py

示例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) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:30,代码来源:test_socket.py

示例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) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:4,代码来源:test_urllib2_localnet.py

示例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) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:32,代码来源:test_ssl.py

示例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) 
开发者ID:dxwu,项目名称:BinderFilter,代码行数:10,代码来源:test_docxmlrpc.py


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