class_docstr: Tests for PathFinder.
class_docstr_tok: ["Tests","for","PathFinder","."]
code: def test_deleted_cwd(self):
      # Issue #22834
      old_dir = os.getcwd()
      self.addCleanup(os.chdir, old_dir)
      new_dir = tempfile.mkdtemp()
      try:
          os.chdir(new_dir)
          try:
              os.rmdir(new_dir)
          except OSError:
              # EINVAL on Solaris, EBUSY on AIX, ENOTEMPTY on Windows
              self.skipTest(
                  "platform does not allow " "the deletion of the cwd"
              )
      except:
          os.chdir(old_dir)
          os.rmdir(new_dir)
          raise
  
      with util.import_state(path=[""]):
          # Do not want FileNotFoundError raised.
          self.assertIsNone(
              self.machinery.PathFinder.find_spec("whatever")
          )
  
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 10 for calling the FinderTests obj's underlying member method code with example usage: obj.test_deleted_cwd() without return types