mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #24285: fix importing extensions from packages
This commit is contained in:
parent
6f68314b2a
commit
55871f04bf
3 changed files with 13 additions and 2 deletions
|
@ -170,6 +170,13 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
|
|||
loader.exec_module(module)
|
||||
return module
|
||||
|
||||
def test_load_submodule(self):
|
||||
'''Test loading a simulated submodule'''
|
||||
module = self.load_module_by_name('pkg.' + self.name)
|
||||
self.assertIsInstance(module, types.ModuleType)
|
||||
self.assertEqual(module.__name__, 'pkg.' + self.name)
|
||||
self.assertEqual(module.str_const, 'something different')
|
||||
|
||||
def test_load_twice(self):
|
||||
'''Test that 2 loads result in 2 module objects'''
|
||||
module1 = self.load_module_by_name(self.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue