From 259fc2533007f7dccc92cae75c8988cdfdb90573 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Tue, 25 Jan 2022 14:14:50 -0500 Subject: [PATCH] test/yaml: Improve YAML parsing error messages Without this commit, a YAML syntactic error is silently ignored. This patch displays the YAML exception, if any, that occurs while loading the YAML config file. --- run.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/run.py b/run.py index ce3615f78..523095bc0 100755 --- a/run.py +++ b/run.py @@ -524,8 +524,11 @@ class TestRunner: def load_config(self): if os.path.exists(os.path.join(self.directory, "test.yaml")): - self.config = yaml.safe_load( - open(os.path.join(self.directory, "test.yaml"), "rb")) + try: + self.config = yaml.safe_load( + open(os.path.join(self.directory, "test.yaml"), "rb")) + except yaml.scanner.ScannerError as e: + print(str(e)) if self.config is None: self.config = {} -- 2.47.2