Skip to content

Commit 3554473

Browse files
committed
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. ........
1 parent b384e6c commit 3554473

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/test/test_ssl.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ def test_timeout(self):
103103

104104

105105
class NetworkedTests(unittest.TestCase):
106+
def setUp(self):
107+
self.old_timeout = socket.getdefaulttimeout()
108+
socket.setdefaulttimeout(30)
109+
110+
def tearDown(self):
111+
socket.setdefaulttimeout(self.old_timeout)
106112

107113
def test_connect(self):
108114
s = ssl.wrap_socket(socket.socket(socket.AF_INET),
@@ -183,8 +189,6 @@ def test_get_server_certificate(self):
183189
if not pem:
184190
self.fail("No server certificate on svn.python.org:443!")
185191

186-
return
187-
188192
try:
189193
pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=CERTFILE)
190194
except ssl.SSLError as x:

0 commit comments

Comments
 (0)