summaryrefslogtreecommitdiff
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2016-08-21 17:43:58 +1000
committerNick Coghlan <ncoghlan@gmail.com>2016-08-21 17:43:58 +1000
commit3bf7a8343ef63bf3d7ce841e73a162fae494bfc4 (patch)
tree64e0e275cd91e0412294389b581da89320cca6cc /Lib/test/test_importlib
parent4d447d25da7684b66186629b8c03ecc5eb7481d7 (diff)
parent00493c0f700e2c1e7c20a10fb3734949c4f9867f (diff)
downloadcpython-3bf7a8343ef63bf3d7ce841e73a162fae494bfc4.tar.gz
Merge #27782 fix from 3.5
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/extension/test_loader.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py
index 154a793ae8..8d20040aab 100644
--- a/Lib/test/test_importlib/extension/test_loader.py
+++ b/Lib/test/test_importlib/extension/test_loader.py
@@ -212,6 +212,15 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
self.assertNotEqual(type(mod), type(unittest))
self.assertEqual(mod.three, 3)
+ # issue 27782
+ def test_nonmodule_with_methods(self):
+ '''Test creating a non-module object with methods defined'''
+ name = self.name + '_nonmodule_with_methods'
+ mod = self.load_module_by_name(name)
+ self.assertNotEqual(type(mod), type(unittest))
+ self.assertEqual(mod.three, 3)
+ self.assertEqual(mod.bar(10, 1), 9)
+
def test_null_slots(self):
'''Test that NULL slots aren't a problem'''
name = self.name + '_null_slots'