Skip socket tests that require the network, if the network resource is not enabled

This commit is contained in:
Daniel Stutzbach 2010-09-09 21:17:58 +00:00
parent 4c7c421944
commit 460ff3dd1c
1 changed files with 2 additions and 0 deletions

View File

@ -642,6 +642,8 @@ class GeneralModuleTests(unittest.TestCase):
# only IP addresses are allowed
self.assertRaises(socket.error, socket.getnameinfo, ('mail.python.org',0), 0)
@unittest.skipUnless(support.is_resource_enabled('network'),
'network is not enabled')
def test_idna(self):
support.requires('network')
# these should all be successful