Django template coverage

69 views
Skip to first unread message

Ned Batchelder

unread,
Aug 24, 2015, 8:45:34 PM8/24/15
to Django users
Hi all,

If you've been using coverage measurement on your Django code, you might be interested in a new development: now you can also measure the coverage of your templates.

Coverage.py 4.0 (currently in the last stages of beta) supports plugins.  Django-coverage-plugin implements measurement of templates: https://pypi.python.org/pypi/django_coverage_plugin  

Install it, run your tests under coverage.py, and you'll see what lines in your templates are used by your tests, and which lines are not.

If you have any trouble with it, let me know,

--Ned.

Avraham Serour

unread,
Sep 20, 2015, 9:46:30 AM9/20/15
to django-users
would this work with jinja2 templates also?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/442ec3ba-ca72-40ff-a637-fd306cf9e096%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ned Batchelder

unread,
Sep 24, 2015, 11:56:27 AM9/24/15
to django...@googlegroups.com
This plugin won't work with Jinja2 templates, but another coverage.py plugin could be written for Jinja2, sure.  Get in touch if you want to get started on it.

--Ned.
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/x0cB75X4puw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages