[Python-checkins] r47047 - python/trunk/Lib/test/test_socket_ssl.py

Neal Norwitz nnorwitz at gmail.com
Tue Jun 20 19:50:36 CEST 2006


I thought you could only use TestSkipped for whole files.  What is
done in other places is print a msg that the test is begin skipped.

(Not to mention Martin's point. :-)

n
--

On 6/20/06, brett.cannon <python-checkins at python.org> wrote:
> 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.
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>


More information about the Python-checkins mailing list