diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-07-14 20:26:34 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-07-14 20:26:34 (GMT) |
commit | 1cae9ec96667e80e85fcdb034206dfd614708cd1 (patch) | |
tree | c99c3b09396a7aedd4cf6f0c67e6f916c569fab3 /Lib/test/test_asyncio/test_events.py | |
parent | acdb782a83d72a823030335e8f190890ae4df9cf (diff) | |
download | cpython-1cae9ec96667e80e85fcdb034206dfd614708cd1.zip cpython-1cae9ec96667e80e85fcdb034206dfd614708cd1.tar.gz cpython-1cae9ec96667e80e85fcdb034206dfd614708cd1.tar.bz2 |
asyncio tests: make quiet the logs of SSL handshake failures when running tests
in debug mode
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 06552f8..b065749 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -819,9 +819,10 @@ class EventLoopTestsMixin: # no CA loaded f_c = self.loop.create_connection(MyProto, host, port, ssl=sslcontext_client) - with self.assertRaisesRegex(ssl.SSLError, - 'certificate verify failed '): - self.loop.run_until_complete(f_c) + with test_utils.disable_logger(): + with self.assertRaisesRegex(ssl.SSLError, + 'certificate verify failed '): + self.loop.run_until_complete(f_c) # close connection self.assertIsNone(proto.transport) @@ -845,9 +846,10 @@ class EventLoopTestsMixin: f_c = self.loop.create_unix_connection(MyProto, path, ssl=sslcontext_client, server_hostname='invalid') - with self.assertRaisesRegex(ssl.SSLError, - 'certificate verify failed '): - self.loop.run_until_complete(f_c) + with test_utils.disable_logger(): + with self.assertRaisesRegex(ssl.SSLError, + 'certificate verify failed '): + self.loop.run_until_complete(f_c) # close connection self.assertIsNone(proto.transport) @@ -871,10 +873,11 @@ class EventLoopTestsMixin: # incorrect server_hostname f_c = self.loop.create_connection(MyProto, host, port, ssl=sslcontext_client) - with self.assertRaisesRegex( - ssl.CertificateError, - "hostname '127.0.0.1' doesn't match 'localhost'"): - self.loop.run_until_complete(f_c) + with test_utils.disable_logger(): + with self.assertRaisesRegex( + ssl.CertificateError, + "hostname '127.0.0.1' doesn't match 'localhost'"): + self.loop.run_until_complete(f_c) # close connection proto.transport.close() |