code: def unwritable_cache_dir(
      self, pytester: Pytester
  ) -> Generator[Path, None, None]:
      cache_dir = pytester.path.joinpath(".pytest_cache")
      cache_dir.mkdir()
      mode = cache_dir.stat().st_mode
      cache_dir.chmod(0)
      if os.access(cache_dir, os.W_OK):
          pytest.skip("Failed to make cache dir unwritable")
  
      yield cache_dir
      cache_dir.chmod(mode)
  
imports: import os
  import shutil
  from pathlib import Path
  from typing import Generator
  from typing import List
  import pytest
  from _pytest.config import ExitCode
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import Pytester
  from _pytest.tmpdir import TempPathFactory
label_desc: Use image node_id 4 for calling the TestNewAPI obj's underlying member method code with example usage: obj.unwritable_cache_dir(pytester) without return types