Add some docstrings for the sanity checker.
@@ -33,18 +33,27 @@ with open(os.path.join(ROOT_DIR, "test-schema.json")) as schema:
def files(paths):
+ """
+ Each test file in the provided paths.
+ """
for path in paths:
with open(path) as test_file:
yield json.load(test_file)
def groups(paths):
+ """
+ Each test group within each file in the provided paths.
+ """
for test_file in files(paths):
for group in test_file:
yield group
def cases(paths):
+ """
+ Each individual test case within all groups within the provided paths.
+ """
for test_group in groups(paths):
for test in test_group["tests"]:
test["schema"] = test_group["schema"]
@@ -52,6 +61,9 @@ def cases(paths):
def collect(root_dir):
+ """
+ All of the test file paths within the given root directory, recursively.
+ """
for root, _, files in os.walk(root_dir):
for filename in fnmatch.filter(files, "*.json"):
yield os.path.join(root, filename)
