Skip to content

Commit e8af239

Browse files
committed
Adapt to the new style of init'ing coverage plugins
1 parent 57456e5 commit e8af239

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

django_coverage_plugin/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from .plugin import Plugin
1+
"""Django Template Coverage Plugin"""
22

3-
# silence pyflakes
4-
Plugin
3+
from .plugin import DjangoTemplatePlugin
4+
5+
6+
def coverage_init(reg, options):
7+
reg.add_file_tracer(DjangoTemplatePlugin())

django_coverage_plugin/plugin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ def read_template_source(filename):
3939
return text
4040

4141

42-
class Plugin(coverage.plugin.CoveragePlugin, coverage.plugin.FileTracer):
42+
class DjangoTemplatePlugin(
43+
coverage.plugin.CoveragePlugin,
44+
coverage.plugin.FileTracer,
45+
):
4346

44-
def __init__(self, options):
45-
super(Plugin, self).__init__(options)
47+
def __init__(self):
4648
self.django_template_dir = os.path.realpath(
4749
os.path.dirname(django.template.__file__)
4850
)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ deps =
2121
django17: Django >=1.7, <1.8
2222
django18: Django >=1.8, <1.9
2323
six >= 1.4.0
24-
coverage >= 4.0a6
24+
coverage >= 4.0a7
2525

2626
commands =
2727
{envpython} -c "import tests.banner"

0 commit comments

Comments
 (0)