mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
asyncio: Fix the second half of issue #21447: race in _write_to_self().
This commit is contained in:
parent
9fafc9f79a
commit
3d139d8ed6
2 changed files with 14 additions and 6 deletions
|
@ -121,8 +121,9 @@ class BaseSelectorEventLoopTests(unittest.TestCase):
|
|||
self.assertIsNone(self.loop._write_to_self())
|
||||
|
||||
def test_write_to_self_exception(self):
|
||||
self.loop._csock.send.side_effect = OSError()
|
||||
self.assertRaises(OSError, self.loop._write_to_self)
|
||||
# _write_to_self() swallows OSError
|
||||
self.loop._csock.send.side_effect = RuntimeError()
|
||||
self.assertRaises(RuntimeError, self.loop._write_to_self)
|
||||
|
||||
def test_sock_recv(self):
|
||||
sock = mock.Mock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue