summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-07-04 21:51:50 (GMT)
committerBrett Cannon <brett@python.org>2013-07-04 21:51:50 (GMT)
commit679ecb565be82ade822411dcfb1b954a60954890 (patch)
tree2e06376ed152ad58a882c57566a5d11549803644 /Lib/test/test_importlib
parent82da8886cc3d8166ab8ef5a257cb04a32ddb1720 (diff)
downloadcpython-679ecb565be82ade822411dcfb1b954a60954890.zip
cpython-679ecb565be82ade822411dcfb1b954a60954890.tar.gz
cpython-679ecb565be82ade822411dcfb1b954a60954890.tar.bz2
Issue #15767: back out 8a0ed9f63c6e, finishing the removal of
ModuleNotFoundError.
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/import_/test_api.py4
-rw-r--r--Lib/test/test_importlib/import_/test_fromlist.py8
2 files changed, 4 insertions, 8 deletions
diff --git a/Lib/test/test_importlib/import_/test_api.py b/Lib/test/test_importlib/import_/test_api.py
index 52a3190..bf74937 100644
--- a/Lib/test/test_importlib/import_/test_api.py
+++ b/Lib/test/test_importlib/import_/test_api.py
@@ -22,10 +22,6 @@ class APITest(unittest.TestCase):
"""Test API-specific details for __import__ (e.g. raising the right
exception when passing in an int for the module name)."""
- def test_raises_ModuleNotFoundError(self):
- with self.assertRaises(ModuleNotFoundError):
- util.import_('some module that does not exist')
-
def test_name_requires_rparition(self):
# Raise TypeError if a non-string is passed in for the module name.
with self.assertRaises(TypeError):
diff --git a/Lib/test/test_importlib/import_/test_fromlist.py b/Lib/test/test_importlib/import_/test_fromlist.py
index a31d216..e440566 100644
--- a/Lib/test/test_importlib/import_/test_fromlist.py
+++ b/Lib/test/test_importlib/import_/test_fromlist.py
@@ -68,16 +68,16 @@ class HandlingFromlist(unittest.TestCase):
self.assertTrue(hasattr(module, 'module'))
self.assertEqual(module.module.__name__, 'pkg.module')
- def test_module_from_package_triggers_ModuleNotFoundError(self):
- # If a submodule causes an ModuleNotFoundError because it tries to import
- # a module which doesn't exist, that should let the ModuleNotFoundError
+ def test_module_from_package_triggers_ImportError(self):
+ # If a submodule causes an ImportError because it tries to import
+ # a module which doesn't exist, that should let the ImportError
# propagate.
def module_code():
import i_do_not_exist
with util.mock_modules('pkg.__init__', 'pkg.mod',
module_code={'pkg.mod': module_code}) as importer:
with util.import_state(meta_path=[importer]):
- with self.assertRaises(ModuleNotFoundError) as exc:
+ with self.assertRaises(ImportError) as exc:
import_util.import_('pkg', fromlist=['mod'])
self.assertEqual('i_do_not_exist', exc.exception.name)