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


Python support.threading_cleanup函数代码示例

本文整理汇总了Python中test.support.threading_cleanup函数的典型用法代码示例。如果您正苦于以下问题:Python threading_cleanup函数的具体用法?Python threading_cleanup怎么用?Python threading_cleanup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了threading_cleanup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_main

def test_main():
    tests = [TestPOP3Class, TestTimeouts, TestPOP3_SSLClass]
    thread_info = test_support.threading_setup()
    try:
        test_support.run_unittest(*tests)
    finally:
        test_support.threading_cleanup(*thread_info)
开发者ID:dot-Sean,项目名称:python-1,代码行数:7,代码来源:test_poplib.py

示例2: test_main

def test_main(verbose=False):
    if skip_expected:
        raise unittest.SkipTest("No SSL support")

    global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT
    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")

    if (not os.path.exists(CERTFILE) or
        not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT)):
        raise support.TestFailed("Can't read certificate files!")

    tests = [BasicTests]

    if support.is_resource_enabled('network'):
        tests.append(NetworkedTests)

    if _have_threads:
        thread_info = support.threading_setup()
        if thread_info and support.is_resource_enabled('network'):
            tests.append(ThreadedTests)

    support.run_unittest(*tests)

    if _have_threads:
        support.threading_cleanup(*thread_info)
开发者ID:Kanma,项目名称:Athena-Dependencies-Python,代码行数:29,代码来源:test_ssl.py

示例3: test_main

def test_main():
    tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
             TestExceptions, BufferIOTest, BasicTCPTest2]
    if sys.platform != 'mac':
        tests.extend([ BasicUDPTest, UDPTimeoutTest ])

    tests.extend([
        NonBlockingTCPTests,
        FileObjectClassTestCase,
        UnbufferedFileObjectClassTestCase,
        LineBufferedFileObjectClassTestCase,
        SmallBufferedFileObjectClassTestCase,
        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 = support.threading_setup()
    support.run_unittest(*tests)
    support.threading_cleanup(*thread_info)
开发者ID:LinkedModernismProject,项目名称:web_code,代码行数:27,代码来源:test_socket.py

示例4: test_main

    def test_main(self):
        threads = []
        thread_info = threading_setup()

        for i in range(NUM_THREADS):
            t = TempFileGreedy()
            threads.append(t)
            t.start()

        startEvent.set()

        ok = 0
        errors = []
        for t in threads:
            t.join()
            ok += t.ok_count
            if t.error_count:
                errors.append(str(t.name) + str(t.errors.getvalue()))

        threading_cleanup(*thread_info)

        msg = "Errors: errors %d ok %d\n%s" % (len(errors), ok,
            '\n'.join(errors))
        self.assertEqual(errors, [], msg)
        self.assertEqual(ok, NUM_THREADS * FILES_PER_THREAD)
开发者ID:henrywoo,项目名称:Python3.1.3-Linux,代码行数:25,代码来源:test_threadedtempfile.py

示例5: tearDown

 def tearDown(self):
     socket.getfqdn = self.real_getfqdn
     # indicate that the client is finished
     self.client_evt.set()
     # wait for the server thread to terminate
     self.serv_evt.wait()
     self.thread.join()
     support.threading_cleanup(*self._threads)
开发者ID:pombredanne,项目名称:cpython,代码行数:8,代码来源:test_smtplib.py

示例6: test_main

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)
开发者ID:pombredanne,项目名称:pyparallel,代码行数:8,代码来源:test_ftplib.py

示例7: tearDown

    def tearDown(self):
        self.client.close()

        self.evt.wait()

        # Disable server feedback
        DocXMLRPCServer._send_traceback_header = False
        support.threading_cleanup(*self._threads)
开发者ID:LPRD,项目名称:build_tools,代码行数:8,代码来源:test_docxmlrpc.py

示例8: tearDown

 def tearDown(self):
     # Stop threads
     self.stop = 1
     for thread in self.threads:
         thread.join()
     thread = None
     self.threads.clear()
     support.threading_cleanup(*self._threading_key)
开发者ID:1st1,项目名称:cpython,代码行数:8,代码来源:fork_wait.py

示例9: tearDown

 def tearDown(self):
     try:
         os.remove(self.filename)
     except EnvironmentError as ee:
         # (Jython addition) detect failure common on Windows, on missing
         # close, that creates spurious errors in subsequent tests.
         if ee.errno != errno.ENOENT:
             raise ee
     support.threading_cleanup(*self._threads)
开发者ID:isaiah,项目名称:jython3,代码行数:9,代码来源:test_file2k.py

示例10: test_main

def test_main():
    tests = [TestPOP3Class, TestTimeouts]
    if SUPPORTS_SSL:
        tests.append(TestPOP3_SSLClass)
    thread_info = test_support.threading_setup()
    try:
        test_support.run_unittest(*tests)
    finally:
        test_support.threading_cleanup(*thread_info)
开发者ID:henrywoo,项目名称:Python3.1.3-Linux,代码行数:9,代码来源:test_poplib.py

示例11: tearDown

    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()
开发者ID:asvetlov,项目名称:cpython,代码行数:12,代码来源:test_utils.py

示例12: test_main

def test_main():
    tests = [TestFTPClass, TestTimeouts, TestNetrcDeprecation]
    if support.IPV6_ENABLED:
        tests.append(TestIPv6Environment)

    if ssl is not None:
        tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass])

    thread_info = support.threading_setup()
    try:
        support.run_unittest(*tests)
    finally:
        support.threading_cleanup(*thread_info)
开发者ID:aholkner,项目名称:cpython,代码行数:13,代码来源:test_ftplib.py

示例13: test_main

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)
    thread_info = support.threading_setup()
    try:
        support.run_unittest(*tests)
    finally:
        support.threading_cleanup(*thread_info)
开发者ID:Kanma,项目名称:Athena-Dependencies-Python,代码行数:14,代码来源:test_ftplib.py

示例14: tearDown

 def tearDown (self):
     support.threading_cleanup(*self._threads)
开发者ID:vemulasravan6,项目名称:cpython,代码行数:2,代码来源:test_asynchat.py

示例15: tearDownModule

def tearDownModule():
    if threads_key:
        support.threading_cleanup(*threads_key)
开发者ID:Eyepea,项目名称:cpython,代码行数:3,代码来源:test_urllib2_localnet.py


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