]> granicus.if.org Git - python/commitdiff
Make the error message regex more lenient so that it matches both
authorGregory P. Smith <greg@krypto.org>
Sat, 16 Jan 2016 01:29:45 +0000 (17:29 -0800)
committerGregory P. Smith <greg@krypto.org>
Sat, 16 Jan 2016 01:29:45 +0000 (17:29 -0800)
"certificate verify failed " and "CERTIFICATE_VERIFY_FAILED " as
some SSL libraries use different text than OpenSSL.

Lib/test/test_asyncio/test_events.py

index f1746043e770a612bd9bff6c5100c46a3ce445b0..e72b86e77c36576c7c5bbb0e2b27ce56e02bc90c 100644 (file)
@@ -999,7 +999,7 @@ class EventLoopTestsMixin:
         with mock.patch.object(self.loop, 'call_exception_handler'):
             with test_utils.disable_logger():
                 with self.assertRaisesRegex(ssl.SSLError,
-                                            'certificate verify failed '):
+                                            '(?i)certificate.verify.failed '):
                     self.loop.run_until_complete(f_c)
 
             # execute the loop to log the connection error
@@ -1033,7 +1033,7 @@ class EventLoopTestsMixin:
         with mock.patch.object(self.loop, 'call_exception_handler'):
             with test_utils.disable_logger():
                 with self.assertRaisesRegex(ssl.SSLError,
-                                            'certificate verify failed '):
+                                            '(?i)certificate.verify.failed '):
                     self.loop.run_until_complete(f_c)
 
             # execute the loop to log the connection error