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


Python support.threading_setup方法代码示例

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


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

示例1: setUp

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUp(self):
        self._threads = support.threading_setup()
        # Enable server feedback
        DocXMLRPCServer._send_traceback_header = True

        self.evt = threading.Event()
        threading.Thread(target=server, args=(self.evt, 1)).start()

        # wait for port to be assigned
        deadline = time.monotonic() + 10.0
        while PORT is None:
            time.sleep(0.010)
            if time.monotonic() > deadline:
                break

        self.client = http.client.HTTPConnection("localhost:%d" % PORT) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:18,代码来源:test_docxmlrpc.py

示例2: setUp

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [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) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:13,代码来源:test_thread.py

示例3: setUp

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUp(self):
        self._threading_key = support.threading_setup()
        self.alive = {}
        self.stop = 0
        self.threads = [] 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:7,代码来源:fork_wait.py

示例4: test_main

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [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) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:12,代码来源:test_ftplib.py

示例5: setUpModule

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUpModule():
    # Store the threading_setup in a key and ensure that it is cleaned up
    # in the tearDown
    global threads_key
    threads_key = support.threading_setup() 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:7,代码来源:test_urllib2_localnet.py

示例6: setUp

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUp(self):
        self._threads = support.threading_setup() 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:4,代码来源:lock_tests.py

示例7: test_main

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [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) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:10,代码来源:test_poplib.py

示例8: setUpClass

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUpClass(cls):
        cls.key = support.threading_setup()
        with open(support.TESTFN, "wb") as f:
            f.write(cls.DATA) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:6,代码来源:test_os.py

示例9: setUp

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUp(self):
        self._get_running_loop = events._get_running_loop
        events._get_running_loop = lambda: None
        self._thread_cleanup = support.threading_setup() 
开发者ID:crossbario,项目名称:txaio,代码行数:6,代码来源:_asyncio_test_utils.py

示例10: test_main

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [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) 
开发者ID:IronLanguages,项目名称:ironpython3,代码行数:12,代码来源:test_ftplib.py

示例11: setUp

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUp(self):
        self._threads = support.threading_setup()
        # Enable server feedback
        DocXMLRPCServer._send_traceback_header = True

        self.evt = threading.Event()
        threading.Thread(target=server, args=(self.evt, 1)).start()

        # wait for port to be assigned
        n = 1000
        while n > 0 and PORT is None:
            time.sleep(0.001)
            n -= 1

        self.client = http.client.HTTPConnection("localhost:%d" % PORT) 
开发者ID:IronLanguages,项目名称:ironpython3,代码行数:17,代码来源:test_docxmlrpc.py

示例12: setUp

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [as 别名]
def setUp(self):
        self._threads = support.threading_setup()
        os.environ = support.EnvironmentVarGuard()
        self.server_started = threading.Event()
        self.thread = TestServerThread(self, self.request_handler)
        self.thread.start()
        self.server_started.wait() 
开发者ID:ShikyoKira,项目名称:Project-New-Reign---Nemesis-Main,代码行数:9,代码来源:test_httpservers.py

示例13: test_main

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [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) 
开发者ID:bkerler,项目名称:android_universal,代码行数:13,代码来源:test_ftplib.py

示例14: test_main

# 需要导入模块: from test import support [as 别名]
# 或者: from test.support import threading_setup [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) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:60,代码来源:test_socket.py


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