Skip to content

check_model_test_directories

This check identifies instances where a model's tests are located in a schema.yml file that is not in the same directory as the model.

Version History

Added in Debby v0.3.0

Parameters

This check does not support any custom parameters.

Info

For more information about how to set custom parameters for a check, see the documentation on configuration.

Source

def check(model: dict, tests: list[dict]):
    model_directory = Path(model["original_file_path"]).parent
    for test in tests:
        test_directory = Path(test["original_file_path"]).parent
        assert test_directory == model_directory