diff options
author | Brett Cannon <bcannon@gmail.com> | 2006-06-20 17:30:26 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2006-06-20 17:30:26 (GMT) |
commit | bb93f4bb0da95a244a1633583a5ad36e6f785de3 (patch) | |
tree | a65b2f8c2f29ee49b2c81dcf809934131a00c61f /Lib/test/test_socket_ssl.py | |
parent | 1fb8d83a540693b03f0bcf273a1b352d5b048157 (diff) | |
download | cpython-bb93f4bb0da95a244a1633583a5ad36e6f785de3.zip cpython-bb93f4bb0da95a244a1633583a5ad36e6f785de3.tar.gz cpython-bb93f4bb0da95a244a1633583a5ad36e6f785de3.tar.bz2 |
Raise TestSkipped when the test socket connection is refused.
Diffstat (limited to 'Lib/test/test_socket_ssl.py')
-rw-r--r-- | Lib/test/test_socket_ssl.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_socket_ssl.py b/Lib/test/test_socket_ssl.py index 074b627..fb84056 100644 --- a/Lib/test/test_socket_ssl.py +++ b/Lib/test/test_socket_ssl.py @@ -3,6 +3,7 @@ import sys from test import test_support import socket +import errno # Optionally test SSL support. This requires the 'network' resource as given # on the regrtest command line. @@ -54,6 +55,12 @@ def test_timeout(): for. If this message is seen often, test_timeout should be changed to use a more reliable address.""" % (ADDR,) return + except socket.err, exc: # In case connection is refused. + if (isinstance(exc.message, tuple) and + exc.message[0] == errno.ECONNREFUSED): + raise test_support.TestSkipped("test socket connection refused") + else: + raise exc ss = socket.ssl(s) # Read part of return welcome banner twice. |