Skip to content

v0.3.0

Latest

Choose a tag to compare

@regularkevvv regularkevvv released this 03 Feb 06:40
· 2 commits to main since this release
4655a7f

Highlights

Template Coverage - Track branch coverage for your Jinja templates with automatic instrumentation, pytest integration, and multiple report formats.

What's Changed

New Features

  • Template Branch Coverage (#4) - Comprehensive coverage tracking for Jinja templates
    • Automatic instrumentation of if/elif/else, for loops, macros, blocks, includes, and ternary expressions
    • Pytest plugin with CLI options: --jt-cov, --jt-cov-fail-under, --jt-cov-report, --jt-cov-exclude
    • Multiple report formats: term, term-missing, html, json, xml (JUnit)
    • Configuration via pyproject.toml under [tool.jinjatest.coverage]
    • New modules: collector, discovery, instrumenter, tracker, reporter, environment

Improvements

  • Stricter Types with Pydantic (#5) - Enhanced type safety across the codebase

    • Added ty type checker to CI pipeline
    • Configured type overrides for test files
  • Updated README (#6) - Streamlined documentation with coverage examples

CI/Build

  • Added build hook to generate _templates.py before tests
  • Added ty check to lint workflow
  • Updated pyproject.toml with coverage plugin entry point

Usage

Enable coverage in your test runs:

pytest --jt-cov --jt-cov-fail-under=80 --jt-cov-report=term

Or configure in pyproject.toml:

[tool.jinjatest.coverage]
enabled = true
fail_under = 80
report = ["term", "html"]
exclude_patterns = ["**/vendor/**"]

Stats

  • 38 files changed
  • +6,338 lines / -243 lines
  • 11 new coverage module files
  • 8 new test files for coverage functionality

Full Changelog

https://github.com/jinjatest/jinjatest/compare/v0.2.0...v0.3.0