summaryrefslogtreecommitdiff
path: root/tests/test_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_events.py')
-rw-r--r--tests/test_events.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_events.py b/tests/test_events.py
index 8cd0ae8..c8e9605 100644
--- a/tests/test_events.py
+++ b/tests/test_events.py
@@ -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