mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866)
This commit is contained in:
parent
dccd41e29f
commit
6012f30bef
6 changed files with 58 additions and 5 deletions
|
@ -3274,6 +3274,19 @@ class _TestListener(BaseTestCase):
|
|||
if self.TYPE == 'processes':
|
||||
self.assertRaises(OSError, l.accept)
|
||||
|
||||
@unittest.skipUnless(util.abstract_sockets_supported,
|
||||
"test needs abstract socket support")
|
||||
def test_abstract_socket(self):
|
||||
with self.connection.Listener("\0something") as listener:
|
||||
with self.connection.Client(listener.address) as client:
|
||||
with listener.accept() as d:
|
||||
client.send(1729)
|
||||
self.assertEqual(d.recv(), 1729)
|
||||
|
||||
if self.TYPE == 'processes':
|
||||
self.assertRaises(OSError, listener.accept)
|
||||
|
||||
|
||||
class _TestListenerClient(BaseTestCase):
|
||||
|
||||
ALLOWED_TYPES = ('processes', 'threads')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue