Code coverage for Jinja2 templates
Asked Answered
W

1

10

I have a Pyramid web application which uses Jinja2 as template engine. It is tested using the Pyramid testing helpers together with py.test and the coverage plugin. But coverage works only for my Python code. Is there way to check also for coverage of Jinja templates?

As Jinja is compiled into Python code and as Armin mananged to give exact line numbers in the case of an exception, I should at least be possible in theory. Any hint would be very appreciated.

Westbrook answered 13/12, 2013 at 14:19 Comment(0)
A
0

There is jinja_coverage.

However, it is incomplete and has a single developer with very little activity (not even published yet). You could also just take its code as hints for how to do it yourself.

Atomize answered 4/5, 2018 at 10:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.