Skip to content

Commit efed401

Browse files
committed
More readme, also test on 1.5
1 parent 60c1d8a commit efed401

File tree

4 files changed

+41
-17
lines changed

4 files changed

+41
-17
lines changed

README.rst

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,52 @@
11
Django Template Coverage Plugin
22
===============================
33

4-
A coverage.py plugin to measure the coverage of Django templates.
4+
A `coverage.py`_ plugin to measure the coverage of Django templates.
55

6-
Details of how to use it are in this `blog post`_. Real docs are TBD.
6+
Supported Python versions are 2.7 and 3.4. Supported Django versions are 1.4
7+
through 1.8 alpha.
78

8-
.. _blog post: http://nedbatchelder.com/blog/201501/coveragepy_for_django_templates.html
9+
The plugin itself is pip installable::
910

11+
$ pip install django_coverage_plugin
1012

11-
To run the tests on Python 2.7::
13+
To run it, add this setting to your .coveragerc::
1214

13-
$ pip install -r requirements.txt
14-
$ tox
15+
[run]
16+
plugins =
17+
django_coverage_plugin
18+
19+
Then run your tests under coverage.py. It requires the latest coverage.py, so
20+
it may not work with other coverage-related tools such as test-runner coverage
21+
plugins, or coveralls.io.
1522

23+
You will see your templates listed in your coverage report alongside your
24+
Python modules.
1625

17-
Yet to be done
26+
27+
What the? How?
1828
--------------
1929

20-
- Plugins can provide data to "debug sys".
30+
The technique used to measure the coverage is the same that Dmitry Trofimov
31+
used in `dtcov`_, but integrated into coverage.py as a plugin, and made more
32+
performant. I'd love to see how well it works in a real production project. If
33+
you want to help me with it, feel free to drop me an email.
34+
35+
The coverage.py plugin mechanism is designed to be generally useful for hooking
36+
into the collection and reporting phases of coverage.py, specifically to
37+
support non-Python files. I've also got a plugin for Mako templates, but it
38+
needs some fixes from Mako. If you have non-Python files you'd like to support
39+
in coverage.py, let's talk.
2140

22-
- Specialize debug tracing?
2341

24-
- Figure out the path to the template so they aren't just simple file names
25-
in the reports.
42+
Tests
43+
-----
44+
45+
To run the tests::
46+
47+
$ pip install -r requirements.txt
48+
$ tox
2649

27-
- How to find unexecuted templates?
2850

29-
- Docs
51+
.. _coverage.py: http://nedbatchelder.com/code/coverage
52+
.. _dtcov: https://github.com/traff/dtcov

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# If you change this file, don't forget to update tox.ini and setup.py also.
22
coverage >= 4.0a4
3-
Django
3+
Django >= 1.4
44
six >= 1.4.0
55
tox >= 1.8

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
setup(
66
name='django_coverage_plugin',
7-
version='0.3',
7+
version='0.3.1',
88
description='Django template coverage.py plugin',
99
author='Ned Batchelder',
1010
author_email='[email protected]',
1111
url='https://github.com/nedbat/django_coverage_plugin',
1212
packages=['django_coverage_plugin'],
1313
install_requires=[
1414
# If you change this, update tox.ini and requirements.txt also.
15-
'Django',
15+
'Django >= 1.4',
1616
'coverage >= 4.0a4',
1717
'six >= 1.4.0',
1818
],

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# tox configuration for django_coverage_plugin.
22

33
[tox]
4-
envlist = py{27,34}-django{14,16,17,18},check
4+
envlist = py{27,34}-django{14,15,16,17,18},check
55

66
[testenv]
77
# Keep these dependencies in sync with the requirements.txt file.
88
deps =
99
django14: Django >=1.4, <1.5
10+
django15: Django >=1.5, <1.6
1011
django16: Django >=1.6, <1.7
1112
django17: Django >=1.7, <1.8
1213
django18: Django >=1.8a1, <1.9

0 commit comments

Comments
 (0)