From: Daniel James Visentin Date: Tue, 23 Dec 2014 01:34:04 +0000 (+1100) Subject: Skip test if check_hostname functionality not available X-Git-Tag: v4.1.0b1~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1270%2Fhead;p=thirdparty%2Ftornado.git Skip test if check_hostname functionality not available --- diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py index 280416844..ad9103435 100644 --- a/tornado/test/iostream_test.py +++ b/tornado/test/iostream_test.py @@ -881,8 +881,14 @@ class TestIOStreamStartTLS(AsyncTestCase): with self.assertRaises(ssl.SSLError): yield client_future + + @unittest.skipIf(not hasattr(ssl, 'create_default_context'), + 'ssl.create_default_context not present') @gen_test def test_check_hostname(self): + # Test that server_hostname parameter to start_tls is being used. + # The check_hostname functionality is only available in python 2.7 and + # up and in python 3.4 and up. self.server_start_tls(_server_ssl_options()) client_future = self.client_start_tls( ssl.create_default_context(),