Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit f7e1ff4

Browse files
Manisha Jainfacebook-github-bot
authored andcommitted
Enable tests in pytext/config:pytext_all_config_test
Summary: Update EXCLUDED_DIRS Reviewed By: hudeven Differential Revision: D19780196 fbshipit-source-id: 7c7ddaa6c7847b013a7bece262bdc366009accca
1 parent b98c294 commit f7e1ff4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pytext/config/test/pytext_all_config_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@
1818
# These JSON files are not parseable configs
1919
EXCLUDE_JSON = {
2020
# used by test_merge_token_labels_to_slot
21-
"utils/tests/test_samples.json"
21+
"utils/tests/test_samples.json",
22+
# "pytext/data/test/data/gpt2_encoder.json",
2223
}
2324
# TODO: @stevenliu T52746850 include all config files from demo, include
2425
# as many as possible from fb
25-
EXCLUDE_DIRS = {"config/test/json_config", "tests/data", "fb", "demo"}
26+
EXCLUDE_DIRS = {"config/test/json_config", "tests/data", "data/test/data", "fb", "demo"}
2627

2728

2829
class LoadAllConfigTest(unittest.TestCase):
2930
def setUp(self):
3031
os.chdir(PYTEXT_HOME)
3132

32-
def DISABLED_test_load_all_configs(self):
33+
def test_load_all_configs(self):
3334
"""
3435
Try an load all the json files in pytext to make sure we didn't
3536
break the config API.
@@ -39,7 +40,7 @@ def DISABLED_test_load_all_configs(self):
3940
exclude_json_dir = {*[get_absolute_path(p) for p in EXCLUDE_DIRS]}
4041
for filename in glob.iglob("./**/*.json", recursive=True):
4142
filepath = get_absolute_path(filename)
42-
if filepath in exclude_json_path:
43+
if any(filepath.endswith(suffix) for suffix in exclude_json_path):
4344
continue
4445
if any(filepath.startswith(prefix) for prefix in exclude_json_dir):
4546
continue

0 commit comments

Comments
 (0)