@@ -262,15 +262,16 @@ def test_reload(self):
262
262
263
263
def test_try_registration (self ):
264
264
# Assert that the PyState_{Find,Add,Remove}Module C API doesn't work.
265
- module = self .load_module ()
266
- with self .subTest ('PyState_FindModule' ):
267
- self .assertEqual (module .call_state_registration_func (0 ), None )
268
- with self .subTest ('PyState_AddModule' ):
269
- with self .assertRaises (SystemError ):
270
- module .call_state_registration_func (1 )
271
- with self .subTest ('PyState_RemoveModule' ):
272
- with self .assertRaises (SystemError ):
273
- module .call_state_registration_func (2 )
265
+ with util .uncache (self .name ):
266
+ module = self .load_module ()
267
+ with self .subTest ('PyState_FindModule' ):
268
+ self .assertEqual (module .call_state_registration_func (0 ), None )
269
+ with self .subTest ('PyState_AddModule' ):
270
+ with self .assertRaises (SystemError ):
271
+ module .call_state_registration_func (1 )
272
+ with self .subTest ('PyState_RemoveModule' ):
273
+ with self .assertRaises (SystemError ):
274
+ module .call_state_registration_func (2 )
274
275
275
276
def test_load_submodule (self ):
276
277
# Test loading a simulated submodule.
0 commit comments