summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_interpreters.py
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-10-17 23:05:49 (GMT)
committerGitHub <noreply@github.com>2023-10-17 23:05:49 (GMT)
commitc58c63fdf615a1c2bfc995dd0b938d82e32b6cde (patch)
treec55bd273d26fdcaf30013a44a7bf973940771a23 /Lib/test/test_interpreters.py
parent7029c1a1c5b864056aa00298b1d0e0269f073f99 (diff)
downloadcpython-c58c63fdf615a1c2bfc995dd0b938d82e32b6cde.zip
cpython-c58c63fdf615a1c2bfc995dd0b938d82e32b6cde.tar.gz
cpython-c58c63fdf615a1c2bfc995dd0b938d82e32b6cde.tar.bz2
gh-84570: Add Timeouts to SendChannel.send() and RecvChannel.recv() (gh-110567)
Diffstat (limited to 'Lib/test/test_interpreters.py')
-rw-r--r--Lib/test/test_interpreters.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_interpreters.py b/Lib/test/test_interpreters.py
index 0910b51..d2d52ec 100644
--- a/Lib/test/test_interpreters.py
+++ b/Lib/test/test_interpreters.py
@@ -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):