diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-10-10 11:34:16 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-10-10 11:34:16 (GMT) |
commit | b77983d2bdedc028c6bdc501fad9dfc385733f6a (patch) | |
tree | 302304a1d49f0e75ec303e9bad1e66e05de491b1 /Lib/test | |
parent | cfb2a0a8559d6d4b3011f1bc04147d25819c7907 (diff) | |
download | cpython-b77983d2bdedc028c6bdc501fad9dfc385733f6a.zip cpython-b77983d2bdedc028c6bdc501fad9dfc385733f6a.tar.gz cpython-b77983d2bdedc028c6bdc501fad9dfc385733f6a.tar.bz2 |
Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present.
Patch by Remi Pointel.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_urllib2net.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index 2662756..51b7fc5 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -7,11 +7,14 @@ import socket import urllib.error import urllib.request import sys + try: import ssl except ImportError: ssl = None +requires_ssl = unittest.skipIf(ssl is None, "SSL not supported") + support.requires("network") TIMEOUT = 60 # seconds @@ -156,6 +159,7 @@ class OtherNetworkTests(unittest.TestCase): ## self._test_urls(urls, self._extra_handlers()+[bauth, dauth]) + @requires_ssl def test_urlwithfrag(self): urlwith_frag = "https://docs.python.org/2/glossary.html#glossary" with support.transient_internet(urlwith_frag): @@ -164,6 +168,7 @@ class OtherNetworkTests(unittest.TestCase): self.assertEqual(res.geturl(), "https://docs.python.org/2/glossary.html#glossary") + @requires_ssl def test_redirect_url_withfrag(self): redirect_url_with_frag = "http://bit.ly/1iSHToT" with support.transient_internet(redirect_url_with_frag): |