Skip to content

Commit b038102

Browse files
committed
Add some docstrings for the sanity checker.
1 parent 20fb14b commit b038102

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bin/jsonschema_suite

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,37 @@ with open(os.path.join(ROOT_DIR, "test-schema.json")) as schema:
3333

3434

3535
def files(paths):
36+
"""
37+
Each test file in the provided paths.
38+
"""
3639
for path in paths:
3740
with open(path) as test_file:
3841
yield json.load(test_file)
3942

4043

4144
def groups(paths):
45+
"""
46+
Each test group within each file in the provided paths.
47+
"""
4248
for test_file in files(paths):
4349
for group in test_file:
4450
yield group
4551

4652

4753
def cases(paths):
54+
"""
55+
Each individual test case within all groups within the provided paths.
56+
"""
4857
for test_group in groups(paths):
4958
for test in test_group["tests"]:
5059
test["schema"] = test_group["schema"]
5160
yield test
5261

5362

5463
def collect(root_dir):
64+
"""
65+
All of the test file paths within the given root directory, recursively.
66+
"""
5567
for root, _, files in os.walk(root_dir):
5668
for filename in fnmatch.filter(files, "*.json"):
5769
yield os.path.join(root, filename)

0 commit comments

Comments
 (0)