MCPcopy Create free account
hub / github.com/tensorflow/datasets / mock_cwd

Function mock_cwd

tensorflow_datasets/scripts/cli/build_test.py:58–63  ·  view source on GitHub ↗

Mock the current directory.

(path: epath.PathLike)

Source from the content-addressed store, hash-verified

56
57@contextlib.contextmanager
58def mock_cwd(path: epath.PathLike) -> Iterator[None]:
59 """Mock the current directory."""
60 path = epath.Path(path)
61 assert path.exists() and path.is_dir() # Check given path is valid cwd dir
62 with mock.patch.object(os, 'getcwd', return_value=os.fspath(path)):
63 yield
64
65
66def _build(

Callers 1

test_build_filesFunction · 0.85

Calls 2

existsMethod · 0.80
is_dirMethod · 0.80

Tested by

no test coverage detected