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

Function test_build_files

tensorflow_datasets/scripts/cli/build_test.py:239–267  ·  view source on GitHub ↗
(build)

Source from the content-addressed store, hash-verified

237
238
239def test_build_files(build):
240 # Make sure DummyDataset isn't registered by default
241 with pytest.raises(tfds.core.registered.DatasetNotFoundError):
242 build('dummy_dataset')
243
244 with pytest.raises(FileNotFoundError, match='Could not find .* script'):
245 build('')
246
247 # cd .../datasets/dummy_dataset && tfds build
248 with mock_cwd(_DUMMY_DATASET_PATH):
249 assert build('') == ['dummy_dataset']
250
251 # cd .../datasets/dummy_dataset && tfds build dummy_dataset.py
252 with mock_cwd(_DUMMY_DATASET_PATH):
253 assert build('dummy_dataset.py') == ['dummy_dataset']
254
255 # cd .../datasets/ && tfds build dummy_dataset
256 with mock_cwd(_DUMMY_DATASET_PATH.parent):
257 assert build('dummy_dataset') == ['dummy_dataset']
258
259 # cd .../datasets/ && tfds build dummy_dataset --imports=xxx
260 # --imports is passed. so do not load dataset from file
261 with mock_cwd(_DUMMY_DATASET_PATH.parent):
262 with pytest.raises(tfds.core.registered.DatasetNotFoundError):
263 assert build('dummy_dataset --imports=os')
264
265 # cd .../datasets/ && tfds build dummy_dataset/dummy_dataset
266 with mock_cwd(_DUMMY_DATASET_PATH.parent):
267 assert build('dummy_dataset/dummy_dataset') == ['dummy_dataset']
268
269
270# Somehow only with tf-nightly, `dummy_dataset` is already imported by

Callers

nothing calls this directly

Calls 1

mock_cwdFunction · 0.85

Tested by

no test coverage detected