mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-23057: add loop self socket as wakeup fd for signals (#11135)
This commit is contained in:
parent
e3666fc8ef
commit
b5c8cfa1da
6 changed files with 104 additions and 6 deletions
|
@ -737,19 +737,19 @@ class BaseProactorEventLoopTests(test_utils.TestCase):
|
|||
|
||||
with mock.patch('asyncio.proactor_events.socket.socketpair',
|
||||
return_value=(self.ssock, self.csock)):
|
||||
self.loop = BaseProactorEventLoop(self.proactor)
|
||||
with mock.patch('signal.set_wakeup_fd'):
|
||||
self.loop = BaseProactorEventLoop(self.proactor)
|
||||
self.set_event_loop(self.loop)
|
||||
|
||||
@mock.patch.object(BaseProactorEventLoop, 'call_soon')
|
||||
@mock.patch('asyncio.proactor_events.socket.socketpair')
|
||||
def test_ctor(self, socketpair, call_soon):
|
||||
def test_ctor(self, socketpair):
|
||||
ssock, csock = socketpair.return_value = (
|
||||
mock.Mock(), mock.Mock())
|
||||
loop = BaseProactorEventLoop(self.proactor)
|
||||
with mock.patch('signal.set_wakeup_fd'):
|
||||
loop = BaseProactorEventLoop(self.proactor)
|
||||
self.assertIs(loop._ssock, ssock)
|
||||
self.assertIs(loop._csock, csock)
|
||||
self.assertEqual(loop._internal_fds, 1)
|
||||
call_soon.assert_called_with(loop._loop_self_reading)
|
||||
loop.close()
|
||||
|
||||
def test_close_self_pipe(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue