當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。