Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present.

Patch by Remi Pointel.
This commit is contained in:
Berker Peksag 2014-10-10 14:35:51 +03:00
commit 8ee1513ada
2 changed files with 11 additions and 0 deletions

View File

@ -7,11 +7,14 @@ import socket
import urllib.error import urllib.error
import urllib.request import urllib.request
import sys import sys
try: try:
import ssl import ssl
except ImportError: except ImportError:
ssl = None ssl = None
requires_ssl = unittest.skipIf(ssl is None, "SSL not supported")
support.requires("network") support.requires("network")
TIMEOUT = 60 # seconds TIMEOUT = 60 # seconds
@ -156,6 +159,7 @@ class OtherNetworkTests(unittest.TestCase):
## self._test_urls(urls, self._extra_handlers()+[bauth, dauth]) ## self._test_urls(urls, self._extra_handlers()+[bauth, dauth])
@requires_ssl
def test_urlwithfrag(self): def test_urlwithfrag(self):
urlwith_frag = "https://docs.python.org/2/glossary.html#glossary" urlwith_frag = "https://docs.python.org/2/glossary.html#glossary"
with support.transient_internet(urlwith_frag): with support.transient_internet(urlwith_frag):
@ -164,6 +168,7 @@ class OtherNetworkTests(unittest.TestCase):
self.assertEqual(res.geturl(), self.assertEqual(res.geturl(),
"https://docs.python.org/2/glossary.html#glossary") "https://docs.python.org/2/glossary.html#glossary")
@requires_ssl
def test_redirect_url_withfrag(self): def test_redirect_url_withfrag(self):
redirect_url_with_frag = "http://bit.ly/1iSHToT" redirect_url_with_frag = "http://bit.ly/1iSHToT"
with support.transient_internet(redirect_url_with_frag): with support.transient_internet(redirect_url_with_frag):

View File

@ -1050,6 +1050,12 @@ IDLE
- Issue #17654: Ensure IDLE menus are customized properly on OS X for - Issue #17654: Ensure IDLE menus are customized properly on OS X for
non-framework builds and for all variants of Tk. non-framework builds and for all variants of Tk.
Tests
-----
- Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not
present. Patch by Remi Pointel.
Build Build
----- -----