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

Function test_mock_data_auto

tensorflow_datasets/testing/mocking_test.py:177–187  ·  view source on GitHub ↗

Test `MockPolicy.AUTO` fallback to `USE_CODE`.

(tmp_path)

Source from the content-addressed store, hash-verified

175
176
177def test_mock_data_auto(tmp_path):
178 """Test `MockPolicy.AUTO` fallback to `USE_CODE`."""
179 # By default, mock data should load metadata when present.
180 with tfds.testing.mock_data():
181 builder = tfds.builder('mnist')
182 assert list(builder.info.splits.keys()) # Metadata should loaded.
183
184 # When mock data unknown, fallback to `USE_CODE` mode.
185 with tfds.testing.mock_data(data_dir=tmp_path):
186 builder = tfds.builder('mnist')
187 assert not list(builder.info.splits.keys()) # Metadata unknown.
188
189
190def test_mock_data_use_code():

Callers

nothing calls this directly

Calls 2

builderMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected