def test_remove_writer(self, glib_loop): import os rfd, wfd = os.pipe() f = os.fdopen(wfd, 'r') glib_loop.add_writer(f, None) os.close(rfd) os.close(wfd) assert glib_loop.remove_writer(f) assert not glib_loop.remove_writer(f.fileno())
def test_remove_writer(self, glib_loop): import os rfd, wfd = os.pipe() f = os.fdopen(wfd, 'r') os.close(rfd) os.close(wfd) glib_loop.add_writer(f, None) assert glib_loop.remove_writer(f) assert not glib_loop.remove_writer(f.fileno())
def remover(fd): nonlocal removed assert glib_loop.remove_writer(fd) removed = True glib_loop.stop()