summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-08-14 17:26:19 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-08-14 17:26:19 (GMT)
commit355447330926fc8e7c8d0163a0739a149d6844a2 (patch)
tree04f75ae5fd7a73954ba48b7131be0aaa359bbd55 /Lib
parentb384e6c7804ebe15c2f85392cdcb8a55aba86e4a (diff)
downloadcpython-355447330926fc8e7c8d0163a0739a149d6844a2.zip
cpython-355447330926fc8e7c8d0163a0739a149d6844a2.tar.gz
cpython-355447330926fc8e7c8d0163a0739a149d6844a2.tar.bz2
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. ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ssl.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 0165de8..193978c 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -103,6 +103,12 @@ class BasicTests(unittest.TestCase):
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 @@ class NetworkedTests(unittest.TestCase):
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: