test_context.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:zanph 作者: zanph 项目源码 文件源码
def test_destroy(self):
        """Context.destroy should close sockets"""
        ctx = self.Context()
        sockets = [ ctx.socket(zmq.REP) for i in range(65) ]

        # close half of the sockets
        [ s.close() for s in sockets[::2] ]

        ctx.destroy()
        # reaper is not instantaneous
        time.sleep(1e-2)
        for s in sockets:
            self.assertTrue(s.closed)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号