[3.7] bpo-34490: Fix test_asyncio for AIX - do not call transport.get_extra_info('sockname') (GH-8907) by asvetlov · Pull Request #9286 · python/cpython
Expand Up
@@ -37,9 +37,11 @@
from test import support
def osx_tiger(): def broken_unix_getsockname(): """Return True if the platform is Mac OS 10.4 or older.""" if sys.platform != 'darwin': if sys.platform.startswith("aix"): return True elif sys.platform != 'darwin': return False version = platform.mac_ver()[0] version = tuple(map(int, version.split('.'))) Expand Down Expand Up @@ -613,7 +615,7 @@ def test_create_connection(self): def test_create_unix_connection(self): # Issue #20682: On Mac OS X Tiger, getsockname() returns a # zero-length address for UNIX socket. check_sockname = not osx_tiger() check_sockname = not broken_unix_getsockname()
with test_utils.run_test_unix_server() as httpd: conn_fut = self.loop.create_unix_connection( Expand Down Expand Up @@ -744,7 +746,7 @@ def test_create_ssl_connection(self): def test_create_ssl_unix_connection(self): # Issue #20682: On Mac OS X Tiger, getsockname() returns a # zero-length address for UNIX socket. check_sockname = not osx_tiger() check_sockname = not broken_unix_getsockname()
with test_utils.run_test_unix_server(use_ssl=True) as httpd: create_connection = functools.partial( Expand Down
def osx_tiger(): def broken_unix_getsockname(): """Return True if the platform is Mac OS 10.4 or older.""" if sys.platform != 'darwin': if sys.platform.startswith("aix"): return True elif sys.platform != 'darwin': return False version = platform.mac_ver()[0] version = tuple(map(int, version.split('.'))) Expand Down Expand Up @@ -613,7 +615,7 @@ def test_create_connection(self): def test_create_unix_connection(self): # Issue #20682: On Mac OS X Tiger, getsockname() returns a # zero-length address for UNIX socket. check_sockname = not osx_tiger() check_sockname = not broken_unix_getsockname()
with test_utils.run_test_unix_server() as httpd: conn_fut = self.loop.create_unix_connection( Expand Down Expand Up @@ -744,7 +746,7 @@ def test_create_ssl_connection(self): def test_create_ssl_unix_connection(self): # Issue #20682: On Mac OS X Tiger, getsockname() returns a # zero-length address for UNIX socket. check_sockname = not osx_tiger() check_sockname = not broken_unix_getsockname()
with test_utils.run_test_unix_server(use_ssl=True) as httpd: create_connection = functools.partial( Expand Down