Skip to content

Commit b11d16e

Browse files
committed
Adjust to coverage.py 4.0b2
1 parent cc609f3 commit b11d16e

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

django_coverage_plugin/plugin.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ def get_line_map(self, filename):
155155

156156
class FileReporter(coverage.plugin.FileReporter):
157157
def __init__(self, filename):
158-
# TODO: do we want the .filename attribute to be part of the public
159-
# API of the coverage plugin?
160-
self.filename = filename
158+
super(FileReporter, self).__init__(filename)
161159
# TODO: html filenames are absolute.
162160

163161
self._source = None
@@ -167,7 +165,7 @@ def source(self):
167165
self._source = read_template_source(self.filename)
168166
return self._source
169167

170-
def statements(self):
168+
def lines(self):
171169
source_lines = set()
172170

173171
if SHOW_PARSING:

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.
2-
coverage >= 4.0b1
2+
coverage >= 4.0b2
33
Django >= 1.4
44
six >= 1.4.0
55
tox >= 1.8

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
install_requires=[
1414
# If you change this, update tox.ini and requirements.txt also.
1515
'Django >= 1.4',
16-
'coverage >= 4.0b1',
16+
'coverage >= 4.0b2',
1717
'six >= 1.4.0',
1818
],
1919
)

tests/plugin_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def run_django_coverage(
8686
tem = get_template(name or self.template_file)
8787
ctx = Context(context or {})
8888
self.cov = coverage.Coverage(**options)
89-
self.cov.config["run:plugins"].append("django_coverage_plugin")
89+
plugins = self.cov.config.get_option("run:plugins")
90+
plugins.append("django_coverage_plugin")
91+
self.cov.config.set_option("run:plugins", plugins)
9092
if 0:
9193
self.cov.config["run:debug"].append("trace")
9294
self.cov.start()

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.0b1
24+
coverage >= 4.0b2
2525

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

0 commit comments

Comments
 (0)