def METHOD_NAME(self):
    # Raise an ImportWarning if sys.meta_path is empty.
    module_name = 'nothing'
    try:
        del sys.modules[module_name]
    except KeyError:
        pass
    with util.import_state(meta_path=[]):
        with warnings.catch_warnings(record=True) as w:
            warnings.simplefilter('always')
            self.assertIsNone(importlib._bootstrap._find_spec('nothing',
                                                              None))
            self.assertEqual(len(w), 1)
            self.assertTrue(issubclass(w[-1].category, ImportWarning))