Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f5ac51 commit e5b25dfCopy full SHA for e5b25df
1 file changed
Lib/test/test_importlib/import_/test_api.py
@@ -26,6 +26,13 @@ def test_raises_ModuleNotFoundError(self):
26
with self.assertRaises(ModuleNotFoundError):
27
util.import_('some module that does not exist')
28
29
+ def test_raises_ModuleNotFoundError_for_None(self):
30
+ # None in sys.modules should raise ModuleNotFoundError.
31
+ with importlib_test_util.uncache('not_here'):
32
+ sys.modules['not_here'] = None
33
+ with self.assertRaises(ModuleNotFoundError):
34
+ util.import_('not_here')
35
+
36
def test_name_requires_rparition(self):
37
# Raise TypeError if a non-string is passed in for the module name.
38
with self.assertRaises(TypeError):
0 commit comments