diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2020-03-09 14:48:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 14:48:03 (GMT) |
commit | 3ede1bc794a575a73c6cc74addb5586f4e33a1f5 (patch) | |
tree | 44b0f2660024c4fc9263cc7048da1dd6cf105485 /Lib/test | |
parent | 97bbdb28b4ab9519780f924e3267ac70af1cd5b8 (diff) | |
download | cpython-3ede1bc794a575a73c6cc74addb5586f4e33a1f5.zip cpython-3ede1bc794a575a73c6cc74addb5586f4e33a1f5.tar.gz cpython-3ede1bc794a575a73c6cc74addb5586f4e33a1f5.tar.bz2 |
[3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876)
(cherry picked from commit 6012f30beff7fa8396718dfb198ccafc333c565b)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 983770f..de91242 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3272,6 +3272,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') |