with self.assertRaises(ImportError):
imp.load_dynamic('nonexistent', pathname)
+ @unittest.skip('known refleak (temporarily skipping)')
@requires_subinterpreters
@requires_load_dynamic
def test_singlephase_multiple_interpreters(self):
# However, globals are still shared.
_interpreters.run_string(interp2, script % 2)
+ @unittest.skip('known refleak (temporarily skipping)')
@requires_load_dynamic
def test_singlephase_variants(self):
- '''Exercise the most meaningful variants described in Python/import.c.'''
+ # Exercise the most meaningful variants described in Python/import.c.
self.maxDiff = None
basename = '_testsinglephase'
_testsinglephase._clear_globals()
self.addCleanup(clean_up)
+ def add_ext_cleanup(name):
+ def clean_up():
+ _testinternalcapi.clear_extension(name, pathname)
+ self.addCleanup(clean_up)
+
modules = {}
def load(name):
assert name not in modules
# Check the "basic" module.
name = basename
+ add_ext_cleanup(name)
expected_init_count = 1
with self.subTest(name):
mod = load(name)
# Check its indirect variants.
name = f'{basename}_basic_wrapper'
+ add_ext_cleanup(name)
expected_init_count += 1
with self.subTest(name):
mod = load(name)
# Check its direct variant.
name = f'{basename}_basic_copy'
+ add_ext_cleanup(name)
expected_init_count += 1
with self.subTest(name):
mod = load(name)
# Check the non-basic variant that has no state.
name = f'{basename}_with_reinit'
+ add_ext_cleanup(name)
with self.subTest(name):
mod = load(name)
lookedup, initialized, cached = check_common(name, mod)
# Check the basic variant that has state.
name = f'{basename}_with_state'
+ add_ext_cleanup(name)
with self.subTest(name):
mod = load(name)
lookedup, initialized, cached = check_common(name, mod)