summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_socket.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index cc8da17..d319112 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1284,12 +1284,11 @@ 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:
+ # Check for internet access before running test
+ # (issue #12804, issue #25138).
+ with support.transient_internet('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
domain = 'испытание.pythontest.net'
socket.gethostbyname(domain)