• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python test_support.threading_cleanup函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: tearDown

 def tearDown(self):
     # indicate that the client is finished
     self.client_evt.set()
     # wait for the server thread to terminate
     self.serv_evt.wait()
     self.thread.join()
     test_support.threading_cleanup(*self._threads)
开发者ID:billtsay,项目名称:win-demo-opcua,代码行数:7,代码来源:test_smtplib.py


示例2: test_main

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

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

    print "Starting"
    startEvent.set()

    print "Reaping"
    ok = errors = 0
    for t in threads:
        t.join()
        ok += t.ok_count
        errors += t.error_count
        if t.error_count:
            print '%s errors:\n%s' % (t.getName(), t.errors.getvalue())

    msg = "Done: errors %d ok %d" % (errors, ok)
    print msg
    if errors:
        raise TestFailed(msg)

    threading_cleanup(*thread_info)
开发者ID:Alex-CS,项目名称:sonify,代码行数:28,代码来源:test_threadedtempfile.py


示例3: 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.getName()) + str(t.errors.getvalue()))

        threading_cleanup(*thread_info)

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


示例4: 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:cimarieta,项目名称:usp,代码行数:7,代码来源:test_poplib.py


示例5: test_main

def test_main(verbose=False):
    if skip_expected:
        raise test_support.TestSkipped("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 test_support.TestFailed("Can't read certificate files!")

    TESTPORT = test_support.find_unused_port()
    if not TESTPORT:
        raise test_support.TestFailed("Can't find open port to test servers on!")

    tests = [BasicTests]

    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)

    test_support.run_unittest(*tests)

    if _have_threads:
        test_support.threading_cleanup(*thread_info)
开发者ID:Cinnz,项目名称:python,代码行数:29,代码来源:test_ssl.py


示例6: 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,
        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:1310701102,项目名称:sl4a,代码行数:28,代码来源:test_socket.py


示例7: tearDown

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

        self.evt.wait()

        # Disable server feedback
        DocXMLRPCServer._send_traceback_header = False
        test_support.threading_cleanup(*self._threads)
开发者ID:billtsay,项目名称:win-demo-opcua,代码行数:8,代码来源:test_docxmlrpc.py


示例8: test_main

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:cimarieta,项目名称:usp,代码行数:8,代码来源:test_ftplib.py


示例9: test_main

def test_main():
    tests = [TestPOP3Class, TestTimeouts]
    if SUPPORTS_SSL and not test_support.due_to_ironpython_bug("http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=28750"):
        tests.append(TestPOP3_SSLClass)
    thread_info = test_support.threading_setup()
    try:
        test_support.run_unittest(*tests)
    finally:
        test_support.threading_cleanup(*thread_info)
开发者ID:BillyboyD,项目名称:main,代码行数:9,代码来源:test_poplib.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:49476291,项目名称:android-plus-plus,代码行数:9,代码来源:test_poplib.py


示例11: 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
     test_support.threading_cleanup(*self._threads)
开发者ID:Stewori,项目名称:jython,代码行数:9,代码来源:test_file2k.py


示例12: tearDown

 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:Alkalit,项目名称:pypyjs,代码行数:11,代码来源:test_file2k.py


示例13: test_main

def test_main():
    tests = [TestImaplib]

    if support.is_resource_enabled('network'):
        if ssl:
            global CERTFILE
            CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
                                    "keycert.pem")
            if not os.path.exists(CERTFILE):
                raise support.TestFailed("Can't read certificate files!")
            tests.append(ThreadedNetworkedTestsSSL)
        tests.append(ThreadedNetworkedTests)

    threadinfo = support.threading_setup()

    support.run_unittest(*tests)

    support.threading_cleanup(*threadinfo)
开发者ID:AojiaoZero,项目名称:CrossApp,代码行数:18,代码来源:test_imaplib.py


示例14: test_main

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

    tests.extend([
        NonBlockingTCPTests,
        FileObjectClassTestCase,
        UnbufferedFileObjectClassTestCase,
        LineBufferedFileObjectClassTestCase,
        SmallBufferedFileObjectClassTestCase
    ])
    if hasattr(socket, "socketpair"):
        tests.append(BasicSocketPairTest)
    if sys.platform == 'linux2':
        tests.append(TestLinuxAbstractNamespace)

    thread_info = test_support.threading_setup()
    test_support.run_unittest(*tests)
    test_support.threading_cleanup(*thread_info)
开发者ID:avenrainbow,项目名称:aven_su,代码行数:21,代码来源:test_socket.py


示例15: decorator

 def decorator(*args):
     key = test_support.threading_setup()
     try:
         return func(*args)
     finally:
         test_support.threading_cleanup(*key)
开发者ID:wujuguang,项目名称:pythonfutures,代码行数:6,代码来源:test_futures.py


示例16: tearDown

 def tearDown(self):
     self.thread.stop()
     os.environ.__exit__()
     test_support.threading_cleanup(*self._threads)
开发者ID:Darriall,项目名称:pypy,代码行数:4,代码来源:test_httpservers.py


示例17: tearDown

 def tearDown(self):
     test_support.threading_cleanup(*self._threads)
开发者ID:321boom,项目名称:The-Powder-Toy,代码行数:2,代码来源:test_urllib2_localnet.py


示例18: tearDown

 def tearDown(self):
     self.doCleanups()
     test_support.threading_cleanup(*self._threads)
开发者ID:RDWang,项目名称:python,代码行数:3,代码来源:test_urllib2_localnet.py


示例19: tearDown

 def tearDown(self):
     support.threading_cleanup(*self._threads)
     support.reap_children()
开发者ID:Jesus00792,项目名称:Maganews,代码行数:3,代码来源:lock_tests.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python test_support.threading_setup函数代码示例发布时间:2022-05-27
下一篇:
Python test_support.temp_cwd函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap