summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-07-08 17:22:31 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-07-08 17:22:31 (GMT)
commit88fcf1bcab11e4db00215339748fa36bcf4a16b6 (patch)
tree736e2cde2d3682758370d52ad9b0dff0acb2e138 /Lib
parent7128f95bd27b34c82299d8572d4172bf0c8a13a3 (diff)
parent72fff046a6d96131d2a929699e6fc8875f57e452 (diff)
downloadcpython-88fcf1bcab11e4db00215339748fa36bcf4a16b6.zip
cpython-88fcf1bcab11e4db00215339748fa36bcf4a16b6.tar.gz
cpython-88fcf1bcab11e4db00215339748fa36bcf4a16b6.tar.bz2
Avoid failing in test_urllibnet.test_bad_address when some overzealous
DNS service (e.g. OpenDNS) resolves a non-existent domain name. The test is now skipped instead.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_urllibnet.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index 03d1708..383b2af 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -113,6 +113,14 @@ class urlopenNetworkTests(unittest.TestCase):
def test_bad_address(self):
# Make sure proper exception is raised when connecting to a bogus
# address.
+ bogus_domain = "sadflkjsasf.i.nvali.d"
+ try:
+ socket.gethostbyname(bogus_domain)
+ except socket.gaierror:
+ pass
+ else:
+ # This happens with some overzealous DNS providers such as OpenDNS
+ self.skipTest("%r should not resolve for test to work" % bogus_domain)
self.assertRaises(IOError,
# SF patch 809915: In Sep 2003, VeriSign started
# highjacking invalid .com and .net addresses to