summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2016-09-08 18:12:31 (GMT)
committerEric Snow <ericsnowcurrently@gmail.com>2016-09-08 18:12:31 (GMT)
commitf3fd06a2e4d42cf8e4e82a5b6cbff1e5a515aff3 (patch)
tree41daf3438e6f223089206197f1dba3f843076be3 /Lib/test/test_importlib
parente58571b7eaa3f282d7d29f3aead1cc8220bec473 (diff)
downloadcpython-f3fd06a2e4d42cf8e4e82a5b6cbff1e5a515aff3.zip
cpython-f3fd06a2e4d42cf8e4e82a5b6cbff1e5a515aff3.tar.gz
cpython-f3fd06a2e4d42cf8e4e82a5b6cbff1e5a515aff3.tar.bz2
Issue #28026: Raise ImportError when exec_module() exists but create_module() is missing.
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/test_util.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/Lib/test/test_importlib/test_util.py b/Lib/test/test_importlib/test_util.py
index 2aa1131..d615375 100644
--- a/Lib/test/test_importlib/test_util.py
+++ b/Lib/test/test_importlib/test_util.py
@@ -47,14 +47,8 @@ class ModuleFromSpecTests:
def exec_module(self, module):
pass
spec = self.machinery.ModuleSpec('test', Loader())
- with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter('always')
+ with self.assertRaises(ImportError):
module = self.util.module_from_spec(spec)
- self.assertEqual(1, len(w))
- self.assertTrue(issubclass(w[0].category, DeprecationWarning))
- self.assertIn('create_module', str(w[0].message))
- self.assertIsInstance(module, types.ModuleType)
- self.assertEqual(module.__name__, spec.name)
def test_create_module_returns_None(self):
class Loader(self.abc.Loader):