MCPcopy
hub / github.com/psf/black / cache_dir

Function cache_dir

tests/test_black.py:77–83  ·  view source on GitHub ↗
(exists: bool = True)

Source from the content-addressed store, hash-verified

75
76@contextmanager
77def cache_dir(exists: bool = True) -> Iterator[Path]:
78 with TemporaryDirectory() as workspace:
79 cache_dir = Path(workspace)
80 if not exists:
81 cache_dir = cache_dir / "new"
82 with patch("black.cache.CACHE_DIR", cache_dir):
83 yield cache_dir
84
85
86@contextmanager

Calls

no outgoing calls

Tested by

no test coverage detected