]> granicus.if.org Git - python/commitdiff
Merged revisions 84021-84023 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 14 Aug 2010 17:28:36 +0000 (17:28 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 14 Aug 2010 17:28:36 +0000 (17:28 +0000)
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.
........

Lib/test/test_ssl.py

index a7bcf9434c72e25ca871f80ffd7504a8614a02bb..c32ee04b3817815207340d44fb35ed1cc68cbe6c 100644 (file)
@@ -181,6 +181,12 @@ class BasicSocketTests(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),