code: def test_cache_failure_warns(
      self,
      pytester: Pytester,
      monkeypatch: MonkeyPatch,
      unwritable_cache_dir: Path,
  ) -> None:
      monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1")
  
      pytester.makepyfile("def test_error(): raise Exception")
      result = pytester.runpytest()
      assert result.ret == 1
      # warnings from nodeids, lastfailed, and stepwise
      result.stdout.fnmatch_lines(
          [
              # Validate location/stacklevel of warning from cacheprovider.
              "*= warnings summary =*",
              "*/cacheprovider.py:*",
              "  */cacheprovider.py:*: PytestCacheWarning: could not create cache path "
              f"{unwritable_cache_dir}/v/cache/nodeids: *",
              '    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))',
              "*1 failed, 3 warnings in*",
          ]
      )
  
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 6 for calling the TestNewAPI obj's underlying member method code with example usage: obj.test_cache_failure_warns(pytester, monkeypatch, unwritable_cache_dir) without return types