]> granicus.if.org Git - python/commitdiff
Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present.
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 10 Oct 2014 11:34:16 +0000 (14:34 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 10 Oct 2014 11:34:16 +0000 (14:34 +0300)
Patch by Remi Pointel.

Lib/test/test_urllib2net.py
Misc/NEWS

index 2662756f7c21718d5ec7e291f5bab37a4f221f77..51b7fc50abd30fd8b7d28749a02e5890cc76bcca 100644 (file)
@@ -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):
index 4fe01097cd21accb15bcb7de8fb9e4e53d1b55f6..eec96b989aff3ac6c4dd421713882994514ffa53 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -55,6 +55,12 @@ Library
 - Issue #22448: Improve canceled timer handles cleanup to prevent
   unbound memory usage. Patch by Joshua Moore-Oliva.
 
+Tests
+-----
+
+- Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not
+  present. Patch by Remi Pointel.
+
 Build
 -----