diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-11-02 16:23:14 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-11-02 16:23:14 (GMT) |
commit | 07df6555c43d54d1708eeee5e27828151e977627 (patch) | |
tree | dbc06d53e189441978e0d13e326a62d6df58e0a6 /Lib/test/test_urllib.py | |
parent | 740e1dcdc22027899cd3e88c2bdc99af8071a805 (diff) | |
download | cpython-07df6555c43d54d1708eeee5e27828151e977627.zip cpython-07df6555c43d54d1708eeee5e27828151e977627.tar.gz cpython-07df6555c43d54d1708eeee5e27828151e977627.tar.bz2 |
Fix test_urllib without the ssl module
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r-- | Lib/test/test_urllib.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index 962ef73..fcd2073 100644 --- a/Lib/test/test_urllib.py +++ b/Lib/test/test_urllib.py @@ -10,7 +10,10 @@ import unittest from unittest.mock import patch from test import support import os -import ssl +try: + import ssl +except ImportError: + ssl = None import sys import tempfile from nturl2path import url2pathname, pathname2url @@ -380,6 +383,7 @@ Content-Type: text/html; charset=iso-8859-1 with support.check_warnings(('',DeprecationWarning)): urllib.request.URLopener() + @unittest.skipUnless(ssl, "ssl module required") def test_cafile_and_context(self): context = ssl.create_default_context() with self.assertRaises(ValueError): |