Python源码示例:asyncio.proactor_events()

示例1
def setUp(self):
        super().setUp()

        self.sock = test_utils.mock_nonblocking_socket()
        self.proactor = mock.Mock()

        self.ssock, self.csock = mock.Mock(), mock.Mock()

        with mock.patch('asyncio.proactor_events.socket.socketpair',
                        return_value=(self.ssock, self.csock)):
            self.loop = BaseProactorEventLoop(self.proactor)
        self.set_event_loop(self.loop)