Issue 19572: More silently skipped tests explicitly skipped.

This commit is contained in:
Zachary Ware 2013-12-08 00:44:27 -06:00
commit 101d9e7250
35 changed files with 135 additions and 142 deletions

View file

@ -745,13 +745,13 @@ class GeneralModuleTests(unittest.TestCase):
ip = socket.gethostbyname(hostname)
except OSError:
# Probably name lookup wasn't set up right; skip this test
return
self.skipTest('name lookup failure')
self.assertTrue(ip.find('.') >= 0, "Error resolving host to ip.")
try:
hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
except OSError:
# Probably a similar problem as above; skip this test
return
self.skipTest('name lookup failure')
all_host_names = [hostname, hname] + aliases
fqhn = socket.getfqdn(ip)
if not fqhn in all_host_names:
@ -977,16 +977,16 @@ class GeneralModuleTests(unittest.TestCase):
try:
from socket import inet_pton, AF_INET6, has_ipv6
if not has_ipv6:
return
self.skipTest('IPv6 not available')
except ImportError:
return
self.skipTest('could not import needed symbols from socket')
if sys.platform == "win32":
try:
inet_pton(AF_INET6, '::')
except OSError as e:
if e.winerror == 10022:
return # IPv6 might not be installed on this PC
self.skipTest('IPv6 might not be supported')
f = lambda a: inet_pton(AF_INET6, a)
assertInvalid = lambda a: self.assertRaises(
@ -1063,16 +1063,16 @@ class GeneralModuleTests(unittest.TestCase):
try:
from socket import inet_ntop, AF_INET6, has_ipv6
if not has_ipv6:
return
self.skipTest('IPv6 not available')
except ImportError:
return
self.skipTest('could not import needed symbols from socket')
if sys.platform == "win32":
try:
inet_ntop(AF_INET6, b'\x00' * 16)
except OSError as e:
if e.winerror == 10022:
return # IPv6 might not be installed on this PC
self.skipTest('IPv6 might not be supported')
f = lambda a: inet_ntop(AF_INET6, a)
assertInvalid = lambda a: self.assertRaises(
@ -1106,7 +1106,7 @@ class GeneralModuleTests(unittest.TestCase):
my_ip_addr = socket.gethostbyname(socket.gethostname())
except OSError:
# Probably name lookup wasn't set up right; skip this test
return
self.skipTest('name lookup failure')
self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
self.assertEqual(name[1], port)