mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-103247: clear the module cache in a test in test_importlib/extensions/test_loader.py (GH-104226)
This commit is contained in:
		
							parent
							
								
									29f348e232
								
							
						
					
					
						commit
						22f3425c3d
					
				
					 1 changed files with 10 additions and 9 deletions
				
			
		|  | @ -262,15 +262,16 @@ def test_reload(self): | |||
| 
 | ||||
|     def test_try_registration(self): | ||||
|         # Assert that the PyState_{Find,Add,Remove}Module C API doesn't work. | ||||
|         module = self.load_module() | ||||
|         with self.subTest('PyState_FindModule'): | ||||
|             self.assertEqual(module.call_state_registration_func(0), None) | ||||
|         with self.subTest('PyState_AddModule'): | ||||
|             with self.assertRaises(SystemError): | ||||
|                 module.call_state_registration_func(1) | ||||
|         with self.subTest('PyState_RemoveModule'): | ||||
|             with self.assertRaises(SystemError): | ||||
|                 module.call_state_registration_func(2) | ||||
|         with util.uncache(self.name): | ||||
|             module = self.load_module() | ||||
|             with self.subTest('PyState_FindModule'): | ||||
|                 self.assertEqual(module.call_state_registration_func(0), None) | ||||
|             with self.subTest('PyState_AddModule'): | ||||
|                 with self.assertRaises(SystemError): | ||||
|                     module.call_state_registration_func(1) | ||||
|             with self.subTest('PyState_RemoveModule'): | ||||
|                 with self.assertRaises(SystemError): | ||||
|                     module.call_state_registration_func(2) | ||||
| 
 | ||||
|     def test_load_submodule(self): | ||||
|         # Test loading a simulated submodule. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 sunmy2019
						sunmy2019