summaryrefslogtreecommitdiff
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2017-09-09 00:30:15 -0700
committerGitHub <noreply@github.com>2017-09-09 00:30:15 -0700
commitefb1d0a3c001a6153211063ba439b9847aa03509 (patch)
treefdfc7187242eb8db236c5b2445b73c61e88b429f /Lib/test/test_socket.py
parent829dacce4fca60fc3c3367980e75e21dfcdbe6be (diff)
downloadcpython-git-efb1d0a3c001a6153211063ba439b9847aa03509.tar.gz
bpo-29639: change test.support.HOST to "localhost"
test.support.HOST should be "localhost" as it was in the past. See the bpo-29639. Tests that need the IP address should use HOSTv4 (added) or the existing HOSTv6 constant. This changes the definition and fixes tests that needed updating to deal with HOST being the hostname rather than the hardcoded IP address. This is only the first step in addressing https://bugs.python.org/issue29639.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 27d9d4944e..05d8761241 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -864,12 +864,12 @@ class GeneralModuleTests(unittest.TestCase):
self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
def test_host_resolution(self):
- for addr in [support.HOST, '10.0.0.1', '255.255.255.255']:
+ for addr in [support.HOSTv4, '10.0.0.1', '255.255.255.255']:
self.assertEqual(socket.gethostbyname(addr), addr)
# we don't test support.HOSTv6 because there's a chance it doesn't have
# a matching name entry (e.g. 'ip6-localhost')
- for host in [support.HOST]:
+ for host in [support.HOSTv4]:
self.assertIn(host, socket.gethostbyaddr(host)[2])
def test_host_resolution_bad_address(self):