def METHOD_NAME(self):
    # If a submodule causes an ModuleNotFoundError because it tries
    # to import a module which doesn't exist, that should let the
    # ModuleNotFoundError propagate.
    def module_code():
        import i_do_not_exist
    with util.mock_spec('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:
                self.__import__('pkg', fromlist=['mod'])
            self.assertEqual('i_do_not_exist', exc.exception.name)