mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-84570: Add Timeouts to SendChannel.send() and RecvChannel.recv() (gh-110567)
This commit is contained in:
parent
7029c1a1c5
commit
c58c63fdf6
8 changed files with 205 additions and 50 deletions
|
@ -1022,6 +1022,11 @@ class TestSendRecv(TestBase):
|
|||
self.assertEqual(obj2, b'eggs')
|
||||
self.assertNotEqual(id(obj2), int(out))
|
||||
|
||||
def test_recv_timeout(self):
|
||||
r, _ = interpreters.create_channel()
|
||||
with self.assertRaises(TimeoutError):
|
||||
r.recv(timeout=1)
|
||||
|
||||
def test_recv_channel_does_not_exist(self):
|
||||
ch = interpreters.RecvChannel(1_000_000)
|
||||
with self.assertRaises(interpreters.ChannelNotFoundError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue