changeset: 92923:ac55331c1df6 branch: 3.4 parent: 92918:61fbd3d5c307 user: Berker Peksag date: Fri Oct 10 14:34:16 2014 +0300 files: Lib/test/test_urllib2net.py Misc/NEWS description: Issue #21456: Skip two tests in test_urllib2net.py if _ssl module not present. Patch by Remi Pointel. diff -r 61fbd3d5c307 -r ac55331c1df6 Lib/test/test_urllib2net.py --- a/Lib/test/test_urllib2net.py Fri Oct 10 12:45:10 2014 +0200 +++ b/Lib/test/test_urllib2net.py Fri Oct 10 14:34:16 2014 +0300 @@ -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 -r 61fbd3d5c307 -r ac55331c1df6 Misc/NEWS --- a/Misc/NEWS Fri Oct 10 12:45:10 2014 +0200 +++ b/Misc/NEWS Fri Oct 10 14:34:16 2014 +0300 @@ -55,6 +55,12 @@ - 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 -----