diff options
author | Yury Selivanov <yury@magic.io> | 2019-05-27 13:57:20 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-27 13:57:19 (GMT) |
commit | 8cd5165ba05ff57cfdbbc71c393bddad1ce1ab87 (patch) | |
tree | ddfd76a4b278f1969c82af389afcc1641cabb005 /Lib/test | |
parent | 674ee1260025ff36f27e5d70ff6b66e3aab880bf (diff) | |
download | cpython-8cd5165ba05ff57cfdbbc71c393bddad1ce1ab87.zip cpython-8cd5165ba05ff57cfdbbc71c393bddad1ce1ab87.tar.gz cpython-8cd5165ba05ff57cfdbbc71c393bddad1ce1ab87.tar.bz2 |
bpo-37027: Return a proxy socket object from transp.get_extra_info('socket') (GH-13530)
Return a safe to use proxy socket object from `transport.get_extra_info('socket')`
https://bugs.python.org/issue37027
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 2 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_server.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 0ae6eab..e89db99 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -1118,7 +1118,7 @@ class EventLoopTestsMixin: f = self.loop.create_server(TestMyProto, sock=sock_ob) server = self.loop.run_until_complete(f) sock = server.sockets[0] - self.assertIs(sock, sock_ob) + self.assertEqual(sock.fileno(), sock_ob.fileno()) host, port = sock.getsockname() self.assertEqual(host, '0.0.0.0') diff --git a/Lib/test/test_asyncio/test_server.py b/Lib/test/test_asyncio/test_server.py index ab7f3de..4e758ad 100644 --- a/Lib/test/test_asyncio/test_server.py +++ b/Lib/test/test_asyncio/test_server.py @@ -58,7 +58,7 @@ class BaseStartServer(func_tests.FunctionalTestCaseMixin): with self.tcp_client(lambda sock: client(sock, addr)): self.loop.run_until_complete(main_task) - self.assertEqual(srv.sockets, []) + self.assertEqual(srv.sockets, ()) self.assertIsNone(srv._sockets) self.assertIsNone(srv._waiters) @@ -111,7 +111,7 @@ class SelectorStartServerTests(BaseStartServer, unittest.TestCase): with self.unix_client(lambda sock: client(sock, addr)): self.loop.run_until_complete(main_task) - self.assertEqual(srv.sockets, []) + self.assertEqual(srv.sockets, ()) self.assertIsNone(srv._sockets) self.assertIsNone(srv._waiters) |