From b8b480807cac649e366a20f1048d0107bf5e4b78 Mon Sep 17 00:00:00 2001 From: Erica Bugden Date: Fri, 5 May 2023 11:55:54 -0400 Subject: [PATCH] tests: Fix: Exclude test include YAML files from tests These partial YAML files are included as part of other test cases and are not intended to be run as separate tests. The tests run based on these partial files were still listed as passing because currently the test system only checks that a test fails configuration, but does not compare the reason for that failure with an expected reason. Since all the included files are invalid partial configurations, configuration generation would necessarily fail, and so the test would "pass". Change-Id: Iaea53b6ff1fa184d284079befe695f22ad53ef09 Signed-off-by: Erica Bugden --- tests/config/yaml/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/config/yaml/conftest.py b/tests/config/yaml/conftest.py index 4b79bd0..3ce2845 100644 --- a/tests/config/yaml/conftest.py +++ b/tests/config/yaml/conftest.py @@ -33,6 +33,10 @@ def pytest_collect_file(parent, path): # not a YAML file: cancel return + if path.fnmatch('*.inc.yaml'): + # not a top-level test file (partial inclusion YAML file) + return + # At the end of this loop, if `path` is # `/home/jo/barectf/tests/config/yaml/2/configs/fail/stream/pct-no.yaml`, # for example, then `elems` is: -- 2.34.1