def METHOD_NAME(self):
    # Test importing a module from a package with an absolute name.
    pkg_name = 'pkg'
    pkg_long_name = '{0}.__init__'.format(pkg_name)
    name = '{0}.mod'.format(pkg_name)
    with mock_modules(pkg_long_name, name) as mock:
        with import_state(meta_path=[mock]):
            module = importlib.import_module(name)
            self.assertEqual(module.__name__, name)