mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #12804: Fix test failures on systems without internet access.
This commit is contained in:
parent
a58c01ba48
commit
61baebd0e1
3 changed files with 16 additions and 6 deletions
|
@ -1168,6 +1168,12 @@ class GeneralModuleTests(unittest.TestCase):
|
|||
@unittest.skipUnless(support.is_resource_enabled('network'),
|
||||
'network is not enabled')
|
||||
def test_idna(self):
|
||||
# Check for internet access before running test (issue #12804).
|
||||
try:
|
||||
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
|
||||
socket.gethostbyname('испытание.python.org')
|
||||
socket.gethostbyname_ex('испытание.python.org')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue