From df6285f3d786f910da778989ffd6add9ffec6801 Mon Sep 17 00:00:00 2001 From: Joshua King Date: Mon, 14 Sep 2026 07:22:47 -0400 Subject: [PATCH] test: fix self-scan UPDATE alternative and POSIX path joining - UPDATE pattern alternative corrected (UPDATE ... children, not UPDATE SET) - allowlist comparison uses as_posix() so Windows separators cannot make the DAO itself appear as an offender --- tests/test_dao_children.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_dao_children.py b/tests/test_dao_children.py index 62c1a87..c9787de 100644 --- a/tests/test_dao_children.py +++ b/tests/test_dao_children.py @@ -492,7 +492,7 @@ def test_children_and_admin_sql_lives_only_in_dao_module() -> None: offenders: list[str] = [] for root in scan_roots: for py in sorted(root.rglob("*.py")): - relative = str(py.relative_to(repo_root)) + relative = py.relative_to(repo_root).as_posix() if relative in allowed: continue if sql_pattern.search(py.read_text()): @@ -543,7 +543,7 @@ def test_dao_test_file_uses_dao_not_raw_table_sql() -> None: if number not in excluded ) sql_pattern = re.compile( - r"(SELECT\s[^\"']*?FROM|INSERT\s+INTO|UPDATE\s+SET|" + r"(SELECT\s[^\"']*?FROM|INSERT\s+INTO|UPDATE|" r"DELETE\s+FROM|FROM|JOIN)\s+['\"]*" r"(children|admin_users)\b", re.IGNORECASE,