"""Syntax-parse every first-party template so a broken tag fails the unit lane. The app only renders a handful of templates in unit tests (e.g. the login page), so a Jinja syntax error elsewhere would otherwise ship green. env.parse() checks syntax without resolving extends/includes/imports — enough to catch an unbalanced or mistyped tag across the whole template tree (e.g. the base.html layout). """ import pathlib import jinja2 import steward _ROOT = pathlib.Path(steward.__file__).parent / "templates" def test_all_steward_templates_parse(): env = jinja2.Environment() files = sorted(_ROOT.rglob("*.html")) assert files, "no steward templates found" for f in files: env.parse(f.read_text()) # raises TemplateSyntaxError on a bad tag