(self)
| 142 | |
| 143 | @contextlib.contextmanager |
| 144 | def mock(self): |
| 145 | with tempfile.TemporaryDirectory() as tmp_dir_: |
| 146 | assert not self._tmp_dir |
| 147 | self._tmp_dir = pathlib.Path(tmp_dir_) |
| 148 | with self._mock() as m: |
| 149 | yield m |
| 150 | self._tmp_dir = None |
| 151 | # TODO(epot): recursively record all. |
| 152 | |
| 153 | def _to_tmp(self, p, *, with_state: bool = False): |
| 154 | """Normalize the path by returning `tmp_path / p`.""" |
no test coverage detected