mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Issue #21503: Use test_both() consistently in test_importlib.
This commit is contained in:
		
							parent
							
								
									d50cee2045
								
							
						
					
					
						commit
						3497c0bf95
					
				
					 30 changed files with 526 additions and 428 deletions
				
			
		|  | @ -1,7 +1,7 @@ | |||
| from .. import abc | ||||
| from .. import util | ||||
| 
 | ||||
| frozen_machinery, source_machinery = util.import_importlib('importlib.machinery') | ||||
| machinery = util.import_importlib('importlib.machinery') | ||||
| 
 | ||||
| import sys | ||||
| import types | ||||
|  | @ -65,8 +65,9 @@ def test_already_imported(self): | |||
|         self.assertEqual(cm.exception.name, module_name) | ||||
| 
 | ||||
| 
 | ||||
| Frozen_LoaderTests, Source_LoaderTests = util.test_both(LoaderTests, | ||||
|         machinery=[frozen_machinery, source_machinery]) | ||||
| (Frozen_LoaderTests, | ||||
|  Source_LoaderTests | ||||
|  ) = util.test_both(LoaderTests, machinery=machinery) | ||||
| 
 | ||||
| 
 | ||||
| @unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module') | ||||
|  | @ -98,9 +99,10 @@ def test_not_builtin(self): | |||
|             method(util.BUILTINS.bad_name) | ||||
|         self.assertRaises(util.BUILTINS.bad_name) | ||||
| 
 | ||||
| Frozen_InspectLoaderTests, Source_InspectLoaderTests = util.test_both( | ||||
|         InspectLoaderTests, | ||||
|         machinery=[frozen_machinery, source_machinery]) | ||||
| 
 | ||||
| (Frozen_InspectLoaderTests, | ||||
|  Source_InspectLoaderTests | ||||
|  ) = util.test_both(InspectLoaderTests, machinery=machinery) | ||||
| 
 | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Eric Snow
						Eric Snow