summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2014-11-02 16:23:14 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2014-11-02 16:23:14 (GMT)
commit07df6555c43d54d1708eeee5e27828151e977627 (patch)
treedbc06d53e189441978e0d13e326a62d6df58e0a6 /Lib/test/test_urllib.py
parent740e1dcdc22027899cd3e88c2bdc99af8071a805 (diff)
downloadcpython-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.py6
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):