Skip to content

Commit aca83df

Browse files
author
The TensorFlow Datasets Authors
committed
DatasetBuilderTestCase mentions new TFDS dummy_data folder format.
PiperOrigin-RevId: 794228212
1 parent 9666187 commit aca83df

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

tensorflow_datasets/testing/dataset_builder_testing.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,19 @@ class DatasetBuilderTestCase(
105105
BUILDER_CONFIGS from the class will be tested.
106106
* DL_EXTRACT_RESULT: `dict[str, str]`, the returned result of mocked
107107
`download_and_extract` method. The values should be the path of files
108-
present in the `fake_examples` directory, relative to that directory.
109-
If not specified, path to `fake_examples` will always be returned.
108+
present in the `fake_examples` (or `dummy_data`) directory, relative to
109+
that directory.
110+
If not specified, path to `fake_examples` (or `dummy_data`) will always be
111+
returned.
110112
* DL_EXTRACT_ONLY_RESULT: `dict[str, str]`, the returned result of mocked
111113
`extract` method. The values should be the path of files present in the
112-
`fake_examples` directory, relative to that directory. If not specified:
114+
`fake_examples` (or `dummy_data`) directory, relative to that directory.
115+
If not specified:
113116
will call DownloadManager `extract` method.
114117
* DL_DOWNLOAD_RESULT: `dict[str, str]`, the returned result of mocked
115118
`download_and_extract` method. The values should be the path of files
116-
present in the `fake_examples` directory, relative to that directory.
119+
present in the `fake_examples` (or `dummy_data`) directory, relative to
120+
that directory.
117121
If not specified: will use DL_EXTRACT_RESULT (this is due to backwards
118122
compatibility and will be removed in the future).
119123
* EXAMPLE_DIR: `str`, the base directory in in which fake examples are
@@ -167,11 +171,9 @@ def setUpClass(cls):
167171
"Assign your DatasetBuilder class to %s.DATASET_CLASS." % name
168172
)
169173

170-
cls._available_cm = visibility.set_availables_tmp(
171-
[
172-
visibility.DatasetType.TFDS_PUBLIC,
173-
]
174-
)
174+
cls._available_cm = visibility.set_availables_tmp([
175+
visibility.DatasetType.TFDS_PUBLIC,
176+
])
175177
cls._available_cm.__enter__() # pylint: disable=protected-access
176178

177179
@classmethod
@@ -398,9 +400,9 @@ def _test_checksums(self):
398400
err_msg = (
399401
"Did you forget to record checksums with `--register_checksums` ? See"
400402
" instructions at:"
401-
" https://www.tensorflow.org/datasets/add_dataset#run_the_generation_codeIf"
402-
" want to opt-out of checksums validation, please add `SKIP_CHECKSUMS ="
403-
" True` to the `DatasetBuilderTestCase`.\n"
403+
" https://www.tensorflow.org/datasets/add_dataset#run_the_generation_code"
404+
" If you want to opt-out of checksums validation, please add "
405+
" `SKIP_CHECKSUMS = True` to the `DatasetBuilderTestCase`.\n"
404406
)
405407
url_infos = self.dataset_class.url_infos
406408
filepath = self.dataset_class._checksums_path # pylint: disable=protected-access
@@ -574,15 +576,13 @@ def _test_description_builder_config(self, builder):
574576

575577
# If configs specified, ensure they are all valid
576578
if builder.builder_config and builder.builder_config.description:
577-
err_msg = textwrap.dedent(
578-
"""\
579+
err_msg = textwrap.dedent("""\
579580
The BuilderConfig description should be a one-line description of
580581
the config.
581582
It shouldn't be the same as `builder.info.description` to avoid
582583
redundancy. Both `config.description` and `builder.info.description`
583584
will be displayed in the catalog.
584-
"""
585-
)
585+
""")
586586
ratio = difflib.SequenceMatcher(
587587
None,
588588
builder.builder_config.description,

0 commit comments

Comments
 (0)