diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-31 13:26:53 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-31 13:26:53 (GMT) |
commit | 942d554c5b4b182c60f63c0ad18974a3870e9fc8 (patch) | |
tree | e6f43bf7a478416f48d80de56facad00df56c52f /Lib/test/test_ssl.py | |
parent | a71bfc46d08bfc63fcc3322f24beb2c7faa37efa (diff) | |
download | cpython-942d554c5b4b182c60f63c0ad18974a3870e9fc8.zip cpython-942d554c5b4b182c60f63c0ad18974a3870e9fc8.tar.gz cpython-942d554c5b4b182c60f63c0ad18974a3870e9fc8.tar.bz2 |
Don't fail in test_ssl when svn.python.org is unavailable
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 3726155..4c12ce4 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -156,18 +156,19 @@ class BasicSocketTests(unittest.TestCase): if not test_support.is_resource_enabled('network'): return remote = ("svn.python.org", 443) - s = ssl.wrap_socket(socket.socket(socket.AF_INET), - cert_reqs=ssl.CERT_NONE, ciphers="ALL") - s.connect(remote) - s = ssl.wrap_socket(socket.socket(socket.AF_INET), - cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT") - s.connect(remote) - # Error checking occurs when connecting, because the SSL context - # isn't created before. - s = ssl.wrap_socket(socket.socket(socket.AF_INET), - cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx") - with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"): + with test_support.transient_internet(remote[0]): + s = ssl.wrap_socket(socket.socket(socket.AF_INET), + cert_reqs=ssl.CERT_NONE, ciphers="ALL") + s.connect(remote) + s = ssl.wrap_socket(socket.socket(socket.AF_INET), + cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT") s.connect(remote) + # Error checking occurs when connecting, because the SSL context + # isn't created before. + s = ssl.wrap_socket(socket.socket(socket.AF_INET), + cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx") + with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"): + s.connect(remote) @test_support.cpython_only def test_refcycle(self): |