[Python-checkins] cpython (2.7): Issue #12012: test_ssl uses test_support.import_module()
victor.stinner
python-checkins at python.org
Sun May 22 13:23:12 CEST 2011
http://hg.python.org/cpython/rev/d5771ed4ec4e
changeset: 70270:d5771ed4ec4e
branch: 2.7
parent: 70266:c0a3e17e677f
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Sun May 22 13:22:28 2011 +0200
summary:
Issue #12012: test_ssl uses test_support.import_module()
Skip the whole file if the SSL module is missing. It was already the case,
except that the SkipTest exception was raised in test_main().
This commit fixes an error in test_ssl if the ssl module is missing.
files:
Lib/test/test_ssl.py | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -20,12 +20,7 @@
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
-# Optionally test SSL support, if we have it in the tested platform
-skip_expected = False
-try:
- import ssl
-except ImportError:
- skip_expected = True
+ssl = test_support.import_module("ssl")
HOST = test_support.HOST
CERTFILE = None
@@ -1334,9 +1329,6 @@
def test_main(verbose=False):
- if skip_expected:
- raise unittest.SkipTest("No SSL support")
-
global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT
CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
"keycert.pem")
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list