mirror of
https://github.com/python/cpython.git
synced 2025-09-20 15:40:32 +00:00
Issue #25138: test_socket.test_idna() uses support.transient_internet() instead
of catching socket.EAI_NODATA error which doesn't exist on FreeBSD.
This commit is contained in:
parent
c3f7731f3c
commit
808d6416e3
1 changed files with 4 additions and 5 deletions
|
@ -1284,12 +1284,11 @@ class GeneralModuleTests(unittest.TestCase):
|
||||||
@unittest.skipUnless(support.is_resource_enabled('network'),
|
@unittest.skipUnless(support.is_resource_enabled('network'),
|
||||||
'network is not enabled')
|
'network is not enabled')
|
||||||
def test_idna(self):
|
def test_idna(self):
|
||||||
# Check for internet access before running test (issue #12804).
|
# Check for internet access before running test
|
||||||
try:
|
# (issue #12804, issue #25138).
|
||||||
|
with support.transient_internet('python.org'):
|
||||||
socket.gethostbyname('python.org')
|
socket.gethostbyname('python.org')
|
||||||
except socket.gaierror as e:
|
|
||||||
if e.errno == socket.EAI_NODATA:
|
|
||||||
self.skipTest('internet access required for this test')
|
|
||||||
# these should all be successful
|
# these should all be successful
|
||||||
domain = 'испытание.pythontest.net'
|
domain = 'испытание.pythontest.net'
|
||||||
socket.gethostbyname(domain)
|
socket.gethostbyname(domain)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue