MCPcopy Index your code
hub / github.com/tensorflow/datasets / mock

Method mock

tensorflow_datasets/testing/test_utils.py:144–151  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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`."""

Callers 2

contextmanagerMethod · 0.95
test_mock_fsFunction · 0.95

Calls 1

_mockMethod · 0.95

Tested by

no test coverage detected