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)
评论列表
文章目录