So I built jinjatest: a Python library + pytest plugin that lets you test Jinja templates with structure, and (the part I haven’t seen elsewhere) get branch coverage reports for templates.
What it does:
- Template branch coverage via runtime instrumentation: pytest --jt-cov, fail-under thresholds, and term/html/json/xml reports
- Type-safe render context validation with Pydantic + StrictUndefined by default (missing vars fail loudly)
- Parse rendered output as JSON/YAML/XML/markdown "(including fenced code blocks) so tests can assert on structured data
- Optional anchors/traces inside templates for section-level assertions / verifying branches were taken
Open to feedback!