def test_empty(self):
        # Raise an ImportWarning if sys.meta_path is empty.
        module_name = 'nothing'
        try:
            del sys.modules[module_name]
        except __HOLE__:
            pass
        with util.import_state(meta_path=[]):
            with warnings.catch_warnings(record=True) as w:
                warnings.simplefilter('always')
                self.assertIsNone(importlib._bootstrap._find_module('nothing',
                                                                    None))
                self.assertEqual(len(w), 1)
                self.assertTrue(issubclass(w[-1].category, ImportWarning))
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_importlib/import_/test_meta_path.py/CallingOrder.test_empty