summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2015-05-26 11:48:17 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2015-05-26 11:48:17 (GMT)
commit55871f04bf0ac1cf0c7b1efd82780b4bf979d4f0 (patch)
treee9e3646bf9edca065d9b1346a2730e68c8f4f181 /Lib/test/test_importlib
parent6f68314b2ac64ac6a47c265e2d1265398cfc8f9c (diff)
downloadcpython-55871f04bf0ac1cf0c7b1efd82780b4bf979d4f0.zip
cpython-55871f04bf0ac1cf0c7b1efd82780b4bf979d4f0.tar.gz
cpython-55871f04bf0ac1cf0c7b1efd82780b4bf979d4f0.tar.bz2
Issue #24285: fix importing extensions from packages
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/extension/test_loader.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py
index 66ac2b1..5813ade 100644
--- a/Lib/test/test_importlib/extension/test_loader.py
+++ b/Lib/test/test_importlib/extension/test_loader.py
@@ -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)