diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-05-29 22:11:36 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-05-29 22:11:36 (GMT) |
commit | 0c70ca9aacde6fc58afc211493fa178a27cf8866 (patch) | |
tree | e9e0dacd4e50bbf74fdfdf180b34df384d4258c5 /Lib | |
parent | 07739f3555fc1a4691defa5b339633689c9d926c (diff) | |
parent | e20056c8f71a8e289016c0cbd5adb5826cd91f64 (diff) | |
download | cpython-0c70ca9aacde6fc58afc211493fa178a27cf8866.zip cpython-0c70ca9aacde6fc58afc211493fa178a27cf8866.tar.gz cpython-0c70ca9aacde6fc58afc211493fa178a27cf8866.tar.bz2 |
merge 3.5 (#24328)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_importlib/extension/test_loader.py | 8 |
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) |