[Python-checkins] r47047 - python/trunk/Lib/test/test_socket_ssl.py
brett.cannon
python-checkins at python.org
Tue Jun 20 19:30:27 CEST 2006
Author: brett.cannon
Date: Tue Jun 20 19:30:26 2006
New Revision: 47047
Modified:
python/trunk/Lib/test/test_socket_ssl.py
Log:
Raise TestSkipped when the test socket connection is refused.
Modified: python/trunk/Lib/test/test_socket_ssl.py
==============================================================================
--- python/trunk/Lib/test/test_socket_ssl.py (original)
+++ python/trunk/Lib/test/test_socket_ssl.py Tue Jun 20 19:30:26 2006
@@ -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 @@
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.
More information about the Python-checkins
mailing list