class_docstr: Tests for PathFinder.
class_docstr_tok: ["Tests","for","PathFinder","."]
code: def test_empty_path_hooks(self):
      # Test that if sys.path_hooks is empty a warning is raised,
      # sys.path_importer_cache gets None set, and PathFinder returns None.
      path_entry = "bogus_path"
      with util.import_state(
          path_importer_cache={}, path_hooks=[], path=[path_entry]
      ):
          with warnings.catch_warnings(record=True) as w:
              warnings.simplefilter("always", ImportWarning)
              warnings.simplefilter("ignore", DeprecationWarning)
              self.assertIsNone(self.find("os"))
              self.assertIsNone(sys.path_importer_cache[path_entry])
              self.assertEqual(len(w), 1)
              self.assertTrue(issubclass(w[-1].category, ImportWarning))
  
imports: from test.test_importlib import util
  import os
  import sys
  import tempfile
  from types import ModuleType
  import unittest
  import warnings
  import zipimport
label_desc: Use image node_id 6 for calling the FinderTests obj's underlying member method code with example usage: obj.test_empty_path_hooks() without return types