class_docstr: Tests for PathFinder.
class_docstr_tok: ["Tests","for","PathFinder","."]
code: def test_invalidate_caches_finders(self):
      # Finders with an invalidate_caches() method have it called.
      class FakeFinder:
          def __init__(self):
              self.called = False
  
          def invalidate_caches(self):
              self.called = True
  
      key = os.path.abspath("finder_to_invalidate")
      cache = {"leave_alone": object(), key: FakeFinder()}
      with util.import_state(path_importer_cache=cache):
          self.machinery.PathFinder.invalidate_caches()
      self.assertTrue(cache[key].called)
  
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 11 for calling the FinderTests obj's underlying member method code with example usage: obj.test_invalidate_caches_finders() without return types