Issue #3583: mention that testing whether a bad address not triggering

an OSError can mean a bad DNS server and not an actual bug.
This commit is contained in:
Brett Cannon 2013-01-11 11:17:53 -05:00
parent 9d30698d9e
commit b463c482bf
1 changed files with 9 additions and 10 deletions

View File

@ -121,16 +121,15 @@ class urlopenNetworkTests(unittest.TestCase):
else: else:
# This happens with some overzealous DNS providers such as OpenDNS # This happens with some overzealous DNS providers such as OpenDNS
self.skipTest("%r should not resolve for test to work" % bogus_domain) self.skipTest("%r should not resolve for test to work" % bogus_domain)
self.assertRaises(OSError, failure_explanation = ('opening an invalid URL did not raise OSError; '
# SF patch 809915: In Sep 2003, VeriSign started 'can be caused by a broken DNS server '
# highjacking invalid .com and .net addresses to '(e.g. returns 404 or hijacks page)')
# boost traffic to their own site. This test with self.assertRaises(OSError, msg=failure_explanation):
# started failing then. One hopes the .invalid # SF patch 809915: In Sep 2003, VeriSign started highjacking
# domain will be spared to serve its defined # invalid .com and .net addresses to boost traffic to their own
# purpose. # site. This test started failing then. One hopes the .invalid
# urllib.urlopen, "http://www.sadflkjsasadf.com/") # domain will be spared to serve its defined purpose.
urllib.request.urlopen, urllib.request.urlopen("http://sadflkjsasf.i.nvali.d/")
"http://sadflkjsasf.i.nvali.d/")
class urlretrieveNetworkTests(unittest.TestCase): class urlretrieveNetworkTests(unittest.TestCase):