test_selectors2.py 文件源码

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

项目:selectors2 作者: SethMichaelLarson 项目源码 文件源码
def test_select_module_defines_does_not_implement_epoll(self):
        # Same as above test except with `select.epoll`.

        # Reset the _DEFAULT_SELECTOR value as if using for the first time.
        selectors2._DEFAULT_SELECTOR = None

        # Now we're going to patch in a bad `epoll`.
        def bad_epoll(*args, **kwargs):
            raise OSError(errno.ENOSYS)

        # Remove all selectors except `select.select` and replace `select.epoll`.
        patch_select_module(self, 'select', epoll=bad_epoll)

        selector = self.make_selector()
        self.assertIsInstance(selector, selectors2.SelectSelector)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号