bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866)

This commit is contained in:
Pablo Galindo 2020-03-09 13:48:01 +00:00 committed by GitHub
parent dccd41e29f
commit 6012f30bef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 5 deletions

View file

@ -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')