Skip a test unless the network resource is available.

This commit is contained in:
Brett Cannon 2013-01-25 22:27:21 -05:00
parent 570c5b2354
commit 80512de43b
1 changed files with 2 additions and 0 deletions

View File

@ -1445,6 +1445,8 @@ class MiscTests(unittest.TestCase):
self.opener_has_handler(o, MyHTTPHandler)
self.opener_has_handler(o, MyOtherHTTPHandler)
@unittest.skipUnless(support.is_resource_enabled('network'),
'test requires network access')
def test_issue16464(self):
opener = urllib.request.build_opener()
request = urllib.request.Request("http://www.python.org/~jeremy/")