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.
This commit is contained in:
Antoine Pitrou 2011-07-08 19:19:57 +02:00
parent 4479841b83
commit 3aba49899c
2 changed files with 15 additions and 0 deletions

View file

@ -113,6 +113,14 @@ def test_fileno(self):
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

View file

@ -16,6 +16,13 @@ Library
- Issue #12467: warnings: fix a race condition if a warning is emitted at
shutdown, if globals()['__file__'] is None.
Tests
-----
- 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.
What's New in Python 3.2.1 release candidate 2?
===============================================