Hi,

I've added support to coverage.py for plugins to support non-Python files, and I've written a plugin to measure Django templates. I'm looking for a collaborator to decide how to complete the work. I'm asking on the dev list because ideally, the plugin would be part of Django itself, although it doesn't have to be. There are also possibilities to change the template engine slightly to make coverage measurement of templates better.

If you'd like to try it, the plugin itself is pip installable: pip install django_coverage_plugin . To run it, add these settings to your .coveragerc:

   [run]
   timid = True   # won't be needed eventually
   plugins =
        django_coverage_plugin

Then run your tests under coverage as you normally would. It requires coverage.py>=4.0a2, so it may not work with other coverage-related tools if you have them, such as coveralls.io. You will see your templates listed in your coverage report alongside your Python modules (they have a .html extension but no directory, that's still to be fixed).

The technique used to measure the coverage is the same that Dmitry Trofimov used in dtcov, but integrated into coverage.py, and made more performant. I'd love to see how well it works in a real production project. If you want to help me with, feel free to reply offlist if it's more appropriate.

Thanks,

--Ned.

--
You received this message because you are subscribed to the Google Groups "Django 
developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/54B85A9E.8050500%40nedbatchelder.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to