diff options
author | Fantix King <fantix.king@gmail.com> | 2022-08-05 07:33:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 07:33:35 (GMT) |
commit | e1d68b3ce71de76b3d7e5852e9bdfdbb4efea2f8 (patch) | |
tree | 83be32855ed66d9c69b936b7fff9454ce4329fe9 /Lib/test/test_asyncio | |
parent | 5f3c9fda1825737fa7b671b995f84a8ab9a4adb8 (diff) | |
download | cpython-e1d68b3ce71de76b3d7e5852e9bdfdbb4efea2f8.zip cpython-e1d68b3ce71de76b3d7e5852e9bdfdbb4efea2f8.tar.gz cpython-e1d68b3ce71de76b3d7e5852e9bdfdbb4efea2f8.tar.bz2 |
gh-95573: Fix a mistake in asyncio ssl tests suppressing all logs (#95687)
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_ssl.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_ssl.py b/Lib/test/test_asyncio/test_ssl.py index 5e3c157..a2b5f8d 100644 --- a/Lib/test/test_asyncio/test_ssl.py +++ b/Lib/test/test_asyncio/test_ssl.py @@ -58,6 +58,16 @@ class MyBaseProto(asyncio.Protocol): self.done.set_result(None) +class MessageOutFilter(logging.Filter): + def __init__(self, msg): + self.msg = msg + + def filter(self, record): + if self.msg in record.msg: + return False + return True + + @unittest.skipIf(ssl is None, 'No ssl module') class TestSSL(test_utils.TestCase): @@ -149,7 +159,7 @@ class TestSSL(test_utils.TestCase): def _silence_eof_received_warning(self): # TODO This warning has to be fixed in asyncio. logger = logging.getLogger('asyncio') - filter = logging.Filter('has no effect when using ssl') + filter = MessageOutFilter('has no effect when using ssl') logger.addFilter(filter) try: yield |