(exists: bool = True)
| 75 | |
| 76 | @contextmanager |
| 77 | def 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 |
no outgoing calls
no test coverage detected