summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/extension/test_loader.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_importlib/extension/test_loader.py')
-rw-r--r--Lib/test/test_importlib/extension/test_loader.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py
index 5813ade..d82c805 100644
--- a/Lib/test/test_importlib/extension/test_loader.py
+++ b/Lib/test/test_importlib/extension/test_loader.py
@@ -177,6 +177,14 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
self.assertEqual(module.__name__, 'pkg.' + self.name)
self.assertEqual(module.str_const, 'something different')
+ def test_load_short_name(self):
+ '''Test loading module with a one-character name'''
+ module = self.load_module_by_name('x')
+ self.assertIsInstance(module, types.ModuleType)
+ self.assertEqual(module.__name__, 'x')
+ self.assertEqual(module.str_const, 'something different')
+ assert 'x' not in sys.modules
+
def test_load_twice(self):
'''Test that 2 loads result in 2 module objects'''
module1 = self.load_module_by_name(self.name)