[Python-checkins] r84033 - in python/branches/release31-maint: Lib/test/test_ssl.py
antoine.pitrou
python-checkins at python.org
Sat Aug 14 19:26:19 CEST 2010
Author: antoine.pitrou
Date: Sat Aug 14 19:26:19 2010
New Revision: 84033
Log:
Merged revisions 84021-84023 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84021 | antoine.pitrou | 2010-08-14 18:24:38 +0200 (sam., 14 août 2010) | 4 lines
Add a reasonable timeout to network SSL tests, so as to avoid buildbot timeouts
when the remote server doesn't answer.
........
r84022 | antoine.pitrou | 2010-08-14 18:32:10 +0200 (sam., 14 août 2010) | 4 lines
This is a better resolution than r84021 (because it will also affect
ssl.get_server_certificate()).
........
r84023 | antoine.pitrou | 2010-08-14 18:33:38 +0200 (sam., 14 août 2010) | 3 lines
There doesn't seem to be a reason for this test to be disabled.
........
Modified:
python/branches/release31-maint/ (props changed)
python/branches/release31-maint/Lib/test/test_ssl.py
Modified: python/branches/release31-maint/Lib/test/test_ssl.py
==============================================================================
--- python/branches/release31-maint/Lib/test/test_ssl.py (original)
+++ python/branches/release31-maint/Lib/test/test_ssl.py Sat Aug 14 19:26:19 2010
@@ -103,6 +103,12 @@
class NetworkedTests(unittest.TestCase):
+ def setUp(self):
+ self.old_timeout = socket.getdefaulttimeout()
+ socket.setdefaulttimeout(30)
+
+ def tearDown(self):
+ socket.setdefaulttimeout(self.old_timeout)
def test_connect(self):
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
@@ -183,8 +189,6 @@
if not pem:
self.fail("No server certificate on svn.python.org:443!")
- return
-
try:
pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=CERTFILE)
except ssl.SSLError as x:
More information about the Python-checkins
mailing list