Fix Python 3.2 compat
This commit is contained in:
@@ -653,7 +653,9 @@ class EventLoopTestsMixin(object):
|
||||
with test_utils.disable_logger():
|
||||
self._basetest_create_ssl_connection(conn_fut, check_sockname)
|
||||
|
||||
self.assertEqual(cm.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
|
||||
# Test for Python 3.2
|
||||
if hasattr(ssl.SSLError, 'reason'):
|
||||
self.assertEqual(cm.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
|
||||
|
||||
@unittest.skipIf(ssl is None, 'No ssl module')
|
||||
def test_create_ssl_connection(self):
|
||||
@@ -910,7 +912,7 @@ class EventLoopTestsMixin(object):
|
||||
with mock.patch.object(self.loop, 'call_exception_handler'):
|
||||
with test_utils.disable_logger():
|
||||
with self.assertRaisesRegex(ssl.SSLError,
|
||||
'certificate verify failed '):
|
||||
'certificate verify failed'):
|
||||
self.loop.run_until_complete(f_c)
|
||||
|
||||
# execute the loop to log the connection error
|
||||
@@ -945,7 +947,7 @@ class EventLoopTestsMixin(object):
|
||||
with mock.patch.object(self.loop, 'call_exception_handler'):
|
||||
with test_utils.disable_logger():
|
||||
with self.assertRaisesRegex(ssl.SSLError,
|
||||
'certificate verify failed '):
|
||||
'certificate verify failed'):
|
||||
self.loop.run_until_complete(f_c)
|
||||
|
||||
# execute the loop to log the connection error
|
||||
|
||||
Reference in New Issue
Block a user