From 48457db394fb39efbbc0d5ddd67fd2eb887c71e8 Mon Sep 17 00:00:00 2001 From: Daniel James Visentin Date: Tue, 23 Dec 2014 12:34:04 +1100 Subject: [PATCH] Skip test if check_hostname functionality not available --- tornado/test/iostream_test.py | 6 ++++++ 1 file changed, 6 insertions(+) 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(), -- 2.47.2