mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Issue #19758: silence PendingDeprecationWarnings in test_importlib.
This commit is contained in:
		
							parent
							
								
									c0e71cd6e2
								
							
						
					
					
						commit
						5c29424f4b
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		|  | @ -10,6 +10,7 @@ | |||
| from test.support import CleanImport | ||||
| import unittest | ||||
| import sys | ||||
| import warnings | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|  | @ -55,10 +56,13 @@ class LegacyLoader(TestLoader): | |||
| 
 | ||||
|     HAM = -1 | ||||
| 
 | ||||
|     @frozen_util.module_for_loader | ||||
|     def load_module(self, module): | ||||
|         module.ham = self.HAM | ||||
|         return module | ||||
|     with warnings.catch_warnings(): | ||||
|         warnings.simplefilter("ignore", PendingDeprecationWarning) | ||||
| 
 | ||||
|         @frozen_util.module_for_loader | ||||
|         def load_module(self, module): | ||||
|             module.ham = self.HAM | ||||
|             return module | ||||
| 
 | ||||
| 
 | ||||
| class ModuleSpecTests: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Eric Snow
						Eric Snow