From 8e743020ba77a98298ca7d632b0bd2564aba2abc Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Mon, 22 Jan 2024 12:51:44 +0100 Subject: [PATCH] Fix for empty tests.yaml and examples.yaml --- ogc/bblocks/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ogc/bblocks/util.py b/ogc/bblocks/util.py index 7613004..c49ee71 100644 --- a/ogc/bblocks/util.py +++ b/ogc/bblocks/util.py @@ -146,6 +146,8 @@ def _load_examples(self): examples = None if self.examples_file.is_file(): examples = load_yaml(self.examples_file) + if not examples: + return None try: jsonschema.validate(examples, get_schema('examples')) except Exception as e: @@ -203,6 +205,8 @@ def get_extra_test_resources(self) -> Generator[dict, None, None]: extra_tests_file = self.files_path / 'tests.yaml' if extra_tests_file.is_file(): extra_tests: list[dict] = cast(list[dict], load_yaml(extra_tests_file)) + if not extra_tests: + return try: jsonschema.validate(extra_tests, get_schema('extra-tests')) except Exception as e: