summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-21 07:04:01 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-21 07:04:01 (GMT)
commit808d6416e37bac2d8aa3ebe869f459d39e46cf0c (patch)
tree687d2991868cdfcf8d520aef0006c27ecbbc38e6 /Lib
parentc3f7731f3c01d360b40928a689a48e24b172b579 (diff)
downloadcpython-808d6416e37bac2d8aa3ebe869f459d39e46cf0c.zip
cpython-808d6416e37bac2d8aa3ebe869f459d39e46cf0c.tar.gz
cpython-808d6416e37bac2d8aa3ebe869f459d39e46cf0c.tar.bz2
Issue #25138: test_socket.test_idna() uses support.transient_internet() instead
of catching socket.EAI_NODATA error which doesn't exist on FreeBSD.
Diffstat (limited to 'Lib')
-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)