本文整理汇总了Python中zmqpy.Context.term方法的典型用法代码示例。如果您正苦于以下问题:Python Context.term方法的具体用法?Python Context.term怎么用?Python Context.term使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zmqpy.Context
的用法示例。
在下文中一共展示了Context.term方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_context_term
# 需要导入模块: from zmqpy import Context [as 别名]
# 或者: from zmqpy.Context import term [as 别名]
def test_context_term(self):
from zmqpy import Context
c = Context()
c.term()
assert c.closed
assert c.zmq_ctx == None
示例2: test_context_socket_term
# 需要导入模块: from zmqpy import Context [as 别名]
# 或者: from zmqpy.Context import term [as 别名]
def test_context_socket_term(self):
from zmqpy import Context, PAIR
c = Context()
socket = c.socket(PAIR)
assert socket
assert c.n_sockets == 1
assert len(c._sockets) == 1
assert not c.closed
c.term()
assert c.n_sockets == 0
assert len(c._sockets) == 0
assert socket.closed
示例3: tearDown
# 需要导入模块: from zmqpy import Context [as 别名]
# 或者: from zmqpy.Context import term [as 别名]
def tearDown(self):
from zmqpy import Context
c = Context()
c.term()