From 54490faca72c5ca801f1f2355d084336cc21dd6f Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 15 Jul 2025 22:31:11 +0200 Subject: [PATCH] Ignore comment out paths --- tests/integration/test_get_app_conf_paths.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/test_get_app_conf_paths.py b/tests/integration/test_get_app_conf_paths.py index 9b5cc7af..4d959e9b 100644 --- a/tests/integration/test_get_app_conf_paths.py +++ b/tests/integration/test_get_app_conf_paths.py @@ -67,6 +67,20 @@ class TestGetAppConfPaths(unittest.TestCase): except Exception: continue for m in cls.pattern.finditer(text): + # Determine the start and end of the current line + start = text.rfind('\n', 0, m.start()) + 1 + end = text.find('\n', start) + line = text[start:end] if end != -1 else text[start:] + + # 1) Skip lines that are entirely commented out + if line.lstrip().startswith('#'): + continue + + # 2) Skip calls preceded by an inline comment + idx_call = line.find('get_app_conf') + idx_hash = line.find('#') + if 0 <= idx_hash < idx_call: + continue lineno = text.count('\n', 0, m.start()) + 1 app_arg = m.group(1).strip() path_arg = m.group(2).strip()