[Python-checkins] cpython (merge 3.4 -> default): Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present.

berker.peksag python-checkins at python.org
Fri Oct 10 13:35:32 CEST 2014


https://hg.python.org/cpython/rev/470ea66f5bee
changeset: 92924:470ea66f5bee
parent: 92922:5f773540e2ef
parent: 92923:ac55331c1df6
user: Berker Peksag <berker.peksag at gmail.com>
date: Fri Oct 10 14:35:51 2014 +0300
summary:
 Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present.
Patch by Remi Pointel.
files:
 Lib/test/test_urllib2net.py | 5 +++++
 Misc/NEWS | 6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -7,11 +7,14 @@
 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 @@
 
 ## 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 @@
 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):
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -1050,6 +1050,12 @@
 - Issue #17654: Ensure IDLE menus are customized properly on OS X for
 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
 -----
 
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /