mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	gh-95573: Fix a mistake in asyncio ssl tests suppressing all logs (#95687)
This commit is contained in:
		
							parent
							
								
									5f3c9fda18
								
							
						
					
					
						commit
						e1d68b3ce7
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		|  | @ -58,6 +58,16 @@ def connection_lost(self, exc): | |||
|             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 @@ def _create_client_ssl_context(self, *, disable_verify=True): | |||
|     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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Fantix King
						Fantix King